Permalink
Browse files

Fire nopriv actions from post and ajax handlers when user is not logg…

…ed in.

git-svn-id: http://svn.automattic.com/wordpress/trunk@10720 1a063a9b-81f0-0310-95a4-ce76da25c4cd
  • Loading branch information...
ryan
ryan committed Mar 5, 2009
1 parent 583b8d5 commit 33de6708232b33cca465ae01bba18dca0f0bbe85
Showing with 7 additions and 3 deletions.
  1. +3 −0 wp-admin/admin-ajax.php
  2. +4 −3 wp-admin/admin-post.php
View
@@ -37,6 +37,9 @@
$x->send();
}
+ if ( !empty( $_POST['action']) )
+ do_action( 'wp_ajax_nopriv_' . $_POST['action'] );
+
die('-1');
}
View
@@ -16,14 +16,15 @@
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'];

0 comments on commit 33de670

Please sign in to comment.