WordPress.org

Make WordPress Core

Ticket #11254: deprecated2.diff

File deprecated2.diff, 931 bytes (added by hawy.php, 8 years ago)
  • deprecated.php

     
    23002300
    23012301        if ( $cur && $cur->umeta_id )
    23022302                do_action( 'deleted_usermeta', $cur->umeta_id, $user_id, $meta_key, $meta_value );
     2303       
     2304        // replace the global current_user with new updated data       
     2305        $GLOBALS['current_user'] = new WP_User($user_id);       
     2306        // to populate the old global variables with new meta specially $userdata
     2307        setup_userdata();       
    23032308
    23042309        return true;
    23052310}
     
    24042409                return false;
    24052410
    24062411        wp_cache_delete($user_id, 'users');
     2412       
     2413        // replace the global current_user with new updated data       
     2414        $GLOBALS['current_user'] = new WP_User($user_id);       
     2415        // to populate the old global variables with new meta specially $userdata
     2416        setup_userdata();
    24072417
    24082418        if ( !$cur )
    24092419                do_action( 'added_usermeta', $wpdb->insert_id, $user_id, $meta_key, $meta_value );