Make WordPress Core

Changeset 36313


Ignore:
Timestamp:
01/15/2016 10:46:38 AM (9 years ago)
Author:
swissspidy
Message:

Users: Always return $current_user in wp_get_current_user(), never a boolean.

Fixes unit tests affected by [36311].

See #19615.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/pluggable.php

    r36311 r36313  
    6363 * @global WP_User $current_user Checks if the current user is set.
    6464 *
    65  * @return bool|WP_User WP_User instance on success, false on XMLRPC Request and invalid auth cookie.
     65 * @return bool Current WP_User instance.
    6666 */
    6767function wp_get_current_user() {
     
    8484        $current_user = null;
    8585        wp_set_current_user( 0 );
    86         return false;
     86        return $current_user;
    8787    }
    8888
    8989    if ( defined('XMLRPC_REQUEST') && XMLRPC_REQUEST ) {
    9090        wp_set_current_user( 0 );
    91         return false;
     91        return $current_user;
    9292    }
    9393
     
    108108    if ( ! $user_id ) {
    109109        wp_set_current_user( 0 );
    110         return false;
     110        return $current_user;
    111111    }
    112112
Note: See TracChangeset for help on using the changeset viewer.