bb_slug_sanitize

The BuddyPress bb slug sanitize function.

Description

bb_slug_sanitize( $slug, (int) $length = 255 ); 

Parameters (2)

0. $slug
The slug.
1. $length — Optional. (int) => 255
The length.

Usage

  1. if ( !function_exists( 'bb_slug_sanitize' ) ) { 
  2. require_once ABSPATH . PLUGINDIR . 'buddypress/bp-forums/bbpress/bb-includes/functions.bb-formatting.php'; 
  3.  
  4. // The slug. 
  5. $slug = null; 
  6.  
  7. // The length. 
  8. $length = 255; 
  9.  
  10. // NOTICE! Understand what this does before running. 
  11. $result = bb_slug_sanitize($slug, $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_slug_sanitize( $slug, $length = 255 ) { 
  2. $_slug = $slug; 
  3. return apply_filters( 'bb_slug_sanitize', bb_sanitize_with_dashes( $slug, $length ), $_slug, $length );