Ticket #5098: 5098.01.patch
File 5098.01.patch, 2.2 KB (added by , 11 years ago) |
---|
-
bp-members/bp-members-functions.php
function bp_core_get_user_domain( $user_id, $user_nicename = false, $user_login 149 149 /** 150 150 * Fetch everything in the wp_users table for a user, without any usermeta. 151 151 * 152 * @ package BuddyPress Core153 * @param int $user_id The ID of the user.152 * @since BuddyPress (1.2.0) 153 * 154 154 * @uses BP_Core_User::get_core_userdata() Performs the query. 155 * 156 * @param int $user_id The ID of the user. 157 * @param bool $requery Should we requery and reset the cache for the user's data. 158 * @return array|bool Array of userdata on success. Boolean false on failure. 155 159 */ 156 function bp_core_get_core_userdata( $user_id ) {160 function bp_core_get_core_userdata( $user_id = 0, $requery = false ) { 157 161 if ( empty( $user_id ) ) 158 162 return false; 159 163 160 if ( !$userdata = wp_cache_get( 'bp_core_userdata_' . $user_id, 'bp' ) ) { 164 // get cache if we're not requerying 165 if ( ! $requery ) { 166 $userdata = wp_cache_get( 'bp_core_userdata_' . $user_id, 'bp' ); 167 } 168 169 // query for userdata if we're explicitly requerying or if cache doesn't exist 170 if ( (bool) $requery === true || $userdata === false ) { 161 171 $userdata = BP_Core_User::get_core_userdata( $user_id ); 162 172 wp_cache_set( 'bp_core_userdata_' . $user_id, $userdata, 'bp' ); 163 173 } 164 return apply_filters( 'bp_core_get_core_userdata', $userdata );174 return apply_filters( 'bp_core_get_core_userdata', $userdata, $user_id ); 165 175 } 166 176 167 177 /** -
bp-settings/bp-settings-actions.php
function bp_settings_action_general() { 143 143 144 144 // Make sure these changes are in $bp for the current page load 145 145 if ( ( false === $email_error ) && ( false === $pass_error ) && ( wp_update_user( $update_user ) ) ) { 146 $bp->displayed_user->userdata = bp_core_get_core_userdata( bp_displayed_user_id() );146 $bp->displayed_user->userdata = bp_core_get_core_userdata( bp_displayed_user_id(), true ); 147 147 } 148 148 149 149 // Password Error