Admin: Use is_user_logged_in() instead of wp_validate_auth_cookie() in admin-post.php.

This matches the authentication check in `admin-ajax.php`, and allows the authentication method to be filtered.

Props jmdodd.
Fixes #45475.


Built from https://develop.svn.wordpress.org/trunk@44615


git-svn-id: http://core.svn.wordpress.org/trunk@44446 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Gary Pendergast 2019-01-16 05:41:50 +00:00
parent 5ed802faf4
commit 4fa5437fc1
2 changed files with 2 additions and 2 deletions

View File

@ -31,7 +31,7 @@ do_action( 'admin_init' );
$action = empty( $_REQUEST['action'] ) ? '' : $_REQUEST['action'];
if ( ! wp_validate_auth_cookie() ) {
if ( ! is_user_logged_in() ) {
if ( empty( $action ) ) {
/**
* Fires on a non-authenticated admin post request where no action is supplied.

View File

@ -13,7 +13,7 @@
*
* @global string $wp_version
*/
$wp_version = '5.1-beta1-44614';
$wp_version = '5.1-beta1-44615';
/**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.