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.



git-svn-id: https://develop.svn.wordpress.org/trunk@44615 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Gary Pendergast 2019-01-16 05:40:04 +00:00
parent 9beaad7878
commit 97c6a43eda

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.