pnp_is_suffix

The Paid Memberships Pro pnp is suffix function.

Description

pnp_is_suffix( $word ); 

Parameters (1)

0. $word
The word.

Usage

  1. if ( !function_exists( 'pnp_is_suffix' ) ) { 
  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_suffix($word); 
  9.  

Defined (1)

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

/includes/lib/name-parser.php  
  1. function pnp_is_suffix($word) { 
  2. // ignore periods 
  3. $word = str_replace('.', '', $word); 
  4. // these are some common suffixes - what am I missing? 
  5. $suffix_array = array('I', 'II', 'III', 'IV', 'V', 'Senior', 'Junior', 'Jr', 'Sr', 'PhD', 'APR', 'RPh', 'PE', 'MD', 'MA', 'DMD', 'CME'); 
  6. foreach ($suffix_array as $suffix) { 
  7. if (strtolower($suffix) == strtolower($word)) 
  8. return $suffix; 
  9. return false;