WordPress.org

Make WordPress Core


Ignore:
Timestamp:
06/25/2017 08:07:08 PM (2 years ago)
Author:
DrewAPicture
Message:

Docs: Add a note to the DocBlock for wp_signon() mentioning that it doesn't handle setting the current user.

Also outlines the conditions that must be met for is_user_logged_in() to work with it.

Part props SergeyBiryukov.
Fixes #28116.

File:
1 edited

Legend:

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

    r40560 r40943  
    1717 * set for a longer period depending on if the 'remember' credential is set to
    1818 * true.
     19 *
     20 * Note: wp_signon() doesn't handle setting the current user. This means that if the
     21 * function is called before the {@see 'init'} hook is fired, is_user_logged_in() will
     22 * evaluate as false until that point. If is_user_logged_in() is needed in conjunction
     23 * with wp_signon(), wp_set_current_user() should be called explicitly.
    1924 *
    2025 * @since 2.5.0
Note: See TracChangeset for help on using the changeset viewer.