mirror of
https://github.com/WordPress/WordPress.git
synced 2024-12-22 17:18:32 +01:00
Fire nopriv actions from post and ajax handlers when user is not logged in.
git-svn-id: http://svn.automattic.com/wordpress/trunk@10720 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
583b8d5cb5
commit
33de670823
@ -37,6 +37,9 @@ if ( ! is_user_logged_in() ) {
|
||||
$x->send();
|
||||
}
|
||||
|
||||
if ( !empty( $_POST['action']) )
|
||||
do_action( 'wp_ajax_nopriv_' . $_POST['action'] );
|
||||
|
||||
die('-1');
|
||||
}
|
||||
|
||||
|
@ -16,14 +16,15 @@ else
|
||||
|
||||
require_once(ABSPATH . 'wp-admin/includes/admin.php');
|
||||
|
||||
if ( !wp_validate_auth_cookie() )
|
||||
wp_die(__('Cheatin’ uh?'));
|
||||
|
||||
nocache_headers();
|
||||
|
||||
do_action('admin_init');
|
||||
|
||||
$action = 'admin_post';
|
||||
|
||||
if ( !wp_validate_auth_cookie() )
|
||||
$action .= '_nopriv';
|
||||
|
||||
if ( !empty($_REQUEST['action']) )
|
||||
$action .= '_' . $_REQUEST['action'];
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user