M_normalize_shortcode

The Membership 2 M normalize shortcode function.

Description

M_normalize_shortcode( $string ); 

Parameters (1)

0. $string
The string.

Usage

  1. if ( !function_exists( 'M_normalize_shortcode' ) ) { 
  2. require_once ABSPATH . PLUGINDIR . 'membership-2/app_old/membershipincludes/includes/functions.php'; 
  3.  
  4. // The string. 
  5. $string = null; 
  6.  
  7. // NOTICE! Understand what this does before running. 
  8. $result = M_normalize_shortcode($string); 
  9.  

Defined (1)

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

/app_old/membershipincludes/includes/functions.php  
  1. function M_normalize_shortcode ($string) { 
  2.  
  3. // Function from http://ie2.php.net/manual/en/function.strtr.php#90925 to remove accented characters for shortcodes 
  4.  
  5. $table = array( 
  6. '*'=>'S', '*'=>'s', '*'=>'Dj', '*'=>'dj', '*'=>'Z', '*'=>'z', '*'=>'C', '*'=>c, '*'=>'C', '*'=>c,  
  7. ''=>'A', ''=>'A', ''=>'A', ''=>'A', ''=>'A', ''=>'A', ''=>'A', ''=>'C', ''=>'E', ''=>'E',  
  8. ''=>'E', ''=>'E', ''=>'I', ''=>'I', ''=>'I', ''=>'I', ''=>'N', ''=>'O', ''=>'O', ''=>'O',  
  9. ''=>'O', ''=>'O', ''=>'O', ''=>'U', ''=>'U', ''=>'U', ''=>'U', ''=>'Y', ''=>'B', ''=>'Ss',  
  10. ''=>'a', ''=>'a', ''=>'a', ''=>'a', ''=>'a', ''=>'a', ''=>'a', ''=>c, ''=>'e', ''=>'e',  
  11. ''=>'e', ''=>'e', ''=>'i', ''=>'i', ''=>'i', ''=>'i', ''=>'o', ''=>n, ''=>'o', ''=>'o',  
  12. ''=>'o', ''=>'o', ''=>'o', ''=>'o', ''=>'u', ''=>'u', ''=>'u', ''=>'y', ''=>'y', ''=>'b',  
  13. ''=>'y', '*'=>'R', '*'=>'r',  
  14. ); 
  15.  
  16. return sanitize_title_with_dashes('level-' . strtolower(strtr($string, $table)));