From f6bf00d378cf7a7e020342068bb9dd30279dc006 Mon Sep 17 00:00:00 2001 From: Drew Jaynes Date: Sun, 25 Jun 2017 20:08:40 +0000 Subject: [PATCH] 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. Built from https://develop.svn.wordpress.org/trunk@40943 git-svn-id: http://core.svn.wordpress.org/trunk@40793 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/user.php | 5 +++++ wp-includes/version.php | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/wp-includes/user.php b/wp-includes/user.php index 2bb4e0543e..e276551628 100644 --- a/wp-includes/user.php +++ b/wp-includes/user.php @@ -17,6 +17,11 @@ * set for a longer period depending on if the 'remember' credential is set to * true. * + * Note: wp_signon() doesn't handle setting the current user. This means that if the + * function is called before the {@see 'init'} hook is fired, is_user_logged_in() will + * evaluate as false until that point. If is_user_logged_in() is needed in conjunction + * with wp_signon(), wp_set_current_user() should be called explicitly. + * * @since 2.5.0 * * @global string $auth_secure_cookie diff --git a/wp-includes/version.php b/wp-includes/version.php index f5625283ca..d7a4749878 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -4,7 +4,7 @@ * * @global string $wp_version */ -$wp_version = '4.9-alpha-40942'; +$wp_version = '4.9-alpha-40943'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.