pnp_is_salutation

The Paid Memberships Pro pnp is salutation function.

Description

pnp_is_salutation( $word ); 

Parameters (1)

0. $word
The word.

Usage

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

Defined (1)

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

/includes/lib/name-parser.php  
  1. function pnp_is_salutation($word) { 
  2. // ignore periods 
  3. $word = str_replace('.', '', strtolower($word)); 
  4. // returns normalized values 
  5. if ($word == "mr" || $word == "master" || $word == "mister") 
  6. return "Mr."; 
  7. else if ($word == "mrs") 
  8. return "Mrs."; 
  9. else if ($word == "miss" || $word == "ms") 
  10. return "Ms."; 
  11. else if ($word == "dr") 
  12. return "Dr."; 
  13. else if ($word == "rev") 
  14. return "Rev."; 
  15. else if ($word == "fr") 
  16. return "Fr."; 
  17. else 
  18. return false;