Make WordPress Core

Changeset 44603


Ignore:
Timestamp:
01/15/2019 06:32:21 AM (6 years ago)
Author:
pento
Message:

Users: Correct the default value in setup_userdata().

The $for_user_id parameter is an int, not a string, so the default value should be 0, rather than an empty string.

Props subrataemfluence.
Fixes #44697.

File:
1 edited

Legend:

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

    r44602 r44603  
    10061006 * @global string  $user_identity The display name of the user
    10071007 *
    1008  * @param int $for_user_id Optional. User ID to set up global data.
    1009  */
    1010 function setup_userdata( $for_user_id = '' ) {
     1008 * @param int $for_user_id Optional. Default 0. User ID to set up global data.
     1009 */
     1010function setup_userdata( $for_user_id = 0 ) {
    10111011    global $user_login, $userdata, $user_level, $user_ID, $user_email, $user_url, $user_identity;
    10121012
    1013     if ( '' == $for_user_id ) {
     1013    if ( ! $for_user_id ) {
    10141014        $for_user_id = get_current_user_id();
    10151015    }
Note: See TracChangeset for help on using the changeset viewer.