Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
12/07/2018 06:41:16 PM (5 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/bp-xprofile-cache.php

    r11818 r12317  
    288288add_action( 'xprofile_field_before_save', 'bp_xprofile_reset_fields_by_name_cache_incrementor' );
    289289
     290/**
     291 * Resets all incremented bp_xprofile_groups caches.
     292 *
     293 * @since 5.0.0
     294 */
     295function bp_xprofile_reset_groups_cache_incrementor() {
     296    bp_core_reset_incrementor( 'bp_xprofile_groups' );
     297}
     298add_action( 'xprofile_group_after_delete', 'bp_xprofile_reset_groups_cache_incrementor' );
     299add_action( 'xprofile_group_after_save', 'bp_xprofile_reset_groups_cache_incrementor' );
     300add_action( 'xprofile_field_after_delete', 'bp_xprofile_reset_groups_cache_incrementor' );
     301add_action( 'xprofile_field_after_save', 'bp_xprofile_reset_groups_cache_incrementor' );
     302
    290303// List actions to clear super cached pages on, if super cache is installed.
    291304add_action( 'xprofile_updated_profile', 'bp_core_clear_cache' );
Note: See TracChangeset for help on using the changeset viewer.