Skip to:
Content

BuddyPress.org

Changeset 7586


Ignore:
Timestamp:
11/16/2013 07:52:59 PM (11 years ago)
Author:
boonebgorges
Message:

Delete core_userdata object cache when updating settings

When updating settings, the settings are sometimes saved on the same pageload
as the settings page is displayed. To ensure that the current pageload's fields
reflect just-changed settings, the persistent object cache key for the saved
settings must be manually busted just after a successful save.

Fixes #5098

Props wpdennis

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/bp-settings/bp-settings-actions.php

    r7562 r7586  
    142142        }
    143143
    144         // Make sure these changes are in $bp for the current page load
     144        // Clear cached data, so that the changed settings take effect
     145        // on the current page load
    145146        if ( ( false === $email_error ) && ( false === $pass_error ) && ( wp_update_user( $update_user ) ) ) {
     147            wp_cache_delete( 'bp_core_userdata_' . bp_displayed_user_id(), 'bp' );
    146148            $bp->displayed_user->userdata = bp_core_get_core_userdata( bp_displayed_user_id() );
    147149        }
Note: See TracChangeset for help on using the changeset viewer.