Skip to:
Content

BuddyPress.org

Changeset 10935


Ignore:
Timestamp:
07/02/2016 11:25:07 AM (5 years ago)
Author:
djpaul
Message:

xprofile: always initialise fields property when fetching field groups.

When using bp_profile_get_field_groups, xprofile field groups without any fields did not have a fields property set in the return value. This changes initialises the property to an empty array, to increase the data consistency of the results.

Fixes #7154

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/bp-xprofile/classes/class-bp-xprofile-group.php

    r10828 r10935  
    372372        $field_ids = $wpdb->get_col( "SELECT id FROM {$bp->profile->table_name_fields} WHERE group_id IN ( {$group_ids_in} ) AND parent_id = 0 {$exclude_fields_sql} {$in_sql} ORDER BY field_order" );
    373373
     374        foreach( $groups as $group ) {
     375            $group->fields = array();
     376        }
     377
    374378        // Bail if no fields.
    375379        if ( empty( $field_ids ) ) {
Note: See TracChangeset for help on using the changeset viewer.