bb_slug_increment

The BuddyPress bb slug increment hook.

Description

apply_filters( 'bb_slug_increment', (string) $r_number, (unknown) $slug, (unknown) $existing_slug, (unknown) $slug_length ); 

Parameters (4)

0. $r_number (string) => "$r-$number"
The number.
1. $slug (unknown)
The slug.
2. $existing_slug (unknown)
The existing slug.
3. $slug_length (unknown)
The slug length.

Usage

To run the hook, copy the example below.
  1. $r_number = apply_filters( 'bb_slug_increment', $r_number, $slug, $existing_slug, $slug_length ); 
  2.  
  3. if ( !empty( $r_number ) ) { 
  4.  
  5. // everything has led up to this point... 
  6.  
  7.  
The following example is for adding a hook callback.
  1. // define the bb_slug_increment callback 
  2. function filter_bb_slug_increment( $r_number, $slug, $existing_slug, $slug_length ) { 
  3. // make filter magic happen here... 
  4. return $r_number
  5. }; 
  6.  
  7. // add the filter 
  8. add_filter( 'bb_slug_increment', 'filter_bb_slug_increment', 10, 4 ); 
To remove a hook callback, use the example below.
  1. // remove the filter 
  2. remove_filter( 'bb_slug_increment', 'filter_bb_slug_increment', 10, 4 ); 

Defined (1)

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

/bp-forums/bbpress/bb-includes/functions.bb-core.php  
  1. return apply_filters( 'bb_slug_increment', "$r-$number", $slug, $existing_slug, $slug_length );