bp_get_button

Filters the requested button output.

Description

apply_filters( 'bp_get_button', (string) $button_contents, (array) $args, (BP_Button) $button ); 

Parameters (3)

0. $button_contents (string)
Button context to be used.
1. $args (array)
Array of args for the button.
2. $button (BP_Button)
BP_Button object.

Usage

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

Defined (1)

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

/bp-core/bp-core-template.php  
  1. return apply_filters( 'bp_get_button', $button->contents, $args, $button );