Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
11/05/2016 12:23:02 AM (5 years ago)
Author:
tw2113
Message:

Adds filters to bp_field_has data return values.

Fixes #6667.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/bp-xprofile/bp-xprofile-template.php

    r10944 r11238  
    204204function bp_field_has_data() {
    205205    global $profile_template;
    206     return $profile_template->field_has_data;
     206
     207    /**
     208     * Filters whether or not the XProfile field has data to display.
     209     *
     210     * @since 2.7.0
     211     *
     212     * @param bool   $value            Whether or not there is data to display.
     213     * @param object $profile_template Profile template object.
     214     * @param string $value            Profile field being displayed.
     215     * @param string $value            Profile field ID being displayed.
     216     */
     217    return apply_filters( 'bp_field_has_data', $profile_template->field_has_data, $profile_template, $profile_template->field, $profile_template->field->id );
    207218}
    208219
     
    219230    global $profile_template;
    220231
    221     if ( ! empty( $profile_template->field_has_data ) ) {
    222         return true;
    223     }
    224 
    225     return false;
     232    /**
     233     * Filters whether or not the XProfile field has public data to display.
     234     *
     235     * @since 2.7.0
     236     *
     237     * @param bool   $value            Whether or not there is public data to display.
     238     * @param object $profile_template Profile template object.
     239     * @param string $value            Profile field being displayed.
     240     * @param string $value            Profile field ID being displayed.
     241     */
     242    return apply_filters( 'bp_field_has_public_data', ( ! empty( $profile_template->field_has_data ) ), $profile_template, $profile_template->field, $profile_template->field->id );
    226243}
    227244
Note: See TracChangeset for help on using the changeset viewer.