Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
10/26/2020 02:11:53 PM (5 years ago)
Author:
boonebgorges
Message:

Declare $get_data = false when calling xprofile_get_field().

The default value of $get_data is true, which means that when calling
xprofile_get_field() with no explicit $user_id, but with a logged-in user,
BP_XProfile_Field::populate() will attempt to fetch the user's data. This
is usually neither intended nor needed, and results in unnecessary database
overhead.

See #8378.

File:
1 edited

Legend:

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

    r12694 r12768  
    311311 */
    312312function xprofile_filter_format_field_value_by_field_id( $field_value, $field_id ) {
    313     $field = xprofile_get_field( $field_id );
     313    $field = xprofile_get_field( $field_id, null, false );
    314314    return xprofile_filter_format_field_value_by_type( $field_value, $field->type, $field_id );
    315315}
Note: See TracChangeset for help on using the changeset viewer.