Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
12/07/2018 06:41:16 PM (6 years ago)
Author:
boonebgorges
Message:

XProfile: Add caching to group and field queries.

See #7435.

File:
1 edited

Legend:

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

    r11847 r12317  
    978978        $parent     = $wpdb->query( $sql );
    979979
     980        $retval = false;
     981
    980982        // Update $field_id with new $position and $field_group_id.
    981983        if ( ! empty( $parent ) && ! is_wp_error( $parent ) ) {
     
    985987            $wpdb->query( $sql );
    986988
    987             // Invalidate profile field cache.
     989            // Invalidate profile field and group query cache.
    988990            wp_cache_delete( $field_id, 'bp_xprofile_fields' );
    989991
    990             return $parent;
    991         }
    992 
    993         return false;
     992            $retval = $parent;
     993        }
     994
     995        bp_core_reset_incrementor( 'bp_xprofile_groups' );
     996
     997        return $retval;
    994998    }
    995999
Note: See TracChangeset for help on using the changeset viewer.