bp_field_has_public_data

Filters whether or not the XProfile field has public data to display.

Description

apply_filters( 'bp_field_has_public_data', (bool) $empty_profile_template_field_has_data, (object) $profile_template, (string) $profile_template_field, (string) $profile_template_field_id ); 

Parameters (4)

0. $empty_profile_template_field_has_data (bool) => ( ! empty( $profile_template->field_has_data ) )
Whether or not there is public data to display.
1. $profile_template (object)
Profile template object.
2. $profile_template_field (string)
Profile field being displayed.
3. $profile_template_field_id (string)
Profile field ID being displayed.

Usage

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

Defined (1)

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

/bp-xprofile/bp-xprofile-template.php  
  1. return apply_filters( 'bp_field_has_public_data', ( ! empty( $profile_template->field_has_data ) ), $profile_template, $profile_template->field, $profile_template->field->id );