bb_user_nicename_sanitize

The BuddyPress bb user nicename sanitize function.

Description

bb_user_nicename_sanitize( (string) $user_nicename, (int) $length = 50 ); 

Parameters (2)

0. $user_nicename (string)
The user nicename.
1. $length — Optional. (int) => 50
The length.

Usage

  1. if ( !function_exists( 'bb_user_nicename_sanitize' ) ) { 
  2. require_once ABSPATH . PLUGINDIR . 'buddypress/bp-forums/bbpress/bb-includes/functions.bb-formatting.php'; 
  3.  
  4. // The user nicename. 
  5. $user_nicename = ''; 
  6.  
  7. // The length. 
  8. $length = 50; 
  9.  
  10. // NOTICE! Understand what this does before running. 
  11. $result = bb_user_nicename_sanitize($user_nicename, $length); 
  12.  

Defined (1)

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

/bp-forums/bbpress/bb-includes/functions.bb-formatting.php  
  1. function bb_user_nicename_sanitize( $user_nicename, $length = 50 ) { 
  2. $_user_nicename = $user_nicename; 
  3. return apply_filters( 'bb_user_nicename_sanitize', bb_sanitize_with_dashes( $user_nicename, $length ), $_user_nicename, $length );