bp_get_the_profile_field_options_radio

Filters the HTML output for an individual field options radio button.

Description

apply_filters( 'bp_get_the_profile_field_options_radio', (string) $new_html, (object) $options_k, (int) $this_field_obj_id, (string) $selected, (string) $k ); 

Parameters (5)

0. $new_html (string)
Label and radio input field.
1. $options_k (object)
Current option being rendered for.
2. $this_field_obj_id (int)
ID of the field object being rendered.
3. $selected (string)
Current selected value.
4. $k (string)
Current index in the foreach loop.

Usage

To run the hook, copy the example below.
  1. $new_html = apply_filters( 'bp_get_the_profile_field_options_radio', $new_html, $options_k, $this_field_obj_id, $selected, $k ); 
  2.  
  3. if ( !empty( $new_html ) ) { 
  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_the_profile_field_options_radio callback 
  2. function filter_bp_get_the_profile_field_options_radio( $new_html, $options_k, $this_field_obj_id, $selected, $k ) { 
  3. // make filter magic happen here... 
  4. return $new_html
  5. }; 
  6.  
  7. // add the filter 
  8. add_filter( 'bp_get_the_profile_field_options_radio', 'filter_bp_get_the_profile_field_options_radio', 10, 5 ); 
To remove a hook callback, use the example below.
  1. // remove the filter 
  2. remove_filter( 'bp_get_the_profile_field_options_radio', 'filter_bp_get_the_profile_field_options_radio', 10, 5 ); 

Defined (1)

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

/bp-xprofile/classes/class-bp-xprofile-field-type-radiobutton.php  
  1. $html .= apply_filters( 'bp_get_the_profile_field_options_radio', $new_html, $options[$k], $this->field_obj->id, $selected, $k );