pnp_safe_ucfirst

The Paid Memberships Pro pnp safe ucfirst function.

Description

pnp_safe_ucfirst( $seperator, $word ); 

Parameters (2)

0. $seperator
The seperator.
1. $word
The word.

Usage

  1. if ( !function_exists( 'pnp_safe_ucfirst' ) ) { 
  2. require_once ABSPATH . PLUGINDIR . 'paid-memberships-pro/includes/lib/name-parser.php'; 
  3.  
  4. // The seperator. 
  5. $seperator = null; 
  6.  
  7. // The word. 
  8. $word = null; 
  9.  
  10. // NOTICE! Understand what this does before running. 
  11. $result = pnp_safe_ucfirst($seperator, $word); 
  12.  

Defined (1)

The function is defined in the following location(s).

/includes/lib/name-parser.php  
  1. function pnp_safe_ucfirst($seperator, $word) { 
  2. // uppercase words split by the seperator (ex. dashes or periods) 
  3. $parts = explode($seperator, $word); 
  4. foreach ($parts as $word) { 
  5. $words[] = (pnp_is_camel_case($word)) ? $word : ucfirst(strtolower($word)); 
  6. return implode($seperator, $words);