Skip to:
Content

BuddyPress.org

Ticket #6667: 6667-data-filters.diff

File 6667-data-filters.diff, 1.7 KB (added by tw2113, 8 years ago)
  • src/bp-xprofile/bp-xprofile-template.php

    diff --git src/bp-xprofile/bp-xprofile-template.php src/bp-xprofile/bp-xprofile-template.php
    index e233f23..c27e798 100644
    function bp_field_css_class( $class = false ) { 
    203203 */
    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
    209220/**
    function bp_field_has_data() { 
    218229function bp_field_has_public_data() {
    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
    228245/**