Allow ['action'] in admin-ajax.php. Props misterbisson. fixes #7945

git-svn-id: https://develop.svn.wordpress.org/trunk@9281 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Ryan Boren 2008-10-22 17:15:19 +00:00
parent a5f43eaf65
commit 4c3ffc92f7
1 changed files with 10 additions and 2 deletions

View File

@ -37,7 +37,9 @@ if ( ! is_user_logged_in() ) {
die('-1');
}
if ( isset($_GET['action']) && 'ajax-tag-search' == $_GET['action'] ) {
if ( isset( $_GET['action'] ) ) :
switch ( $action = $_GET['action'] ) :
case 'ajax-tag-search' :
if ( !current_user_can( 'manage_categories' ) )
die('-1');
@ -53,7 +55,13 @@ if ( isset($_GET['action']) && 'ajax-tag-search' == $_GET['action'] ) {
$results = $wpdb->get_col( "SELECT name FROM $wpdb->terms WHERE name LIKE ('%". $s . "%')" );
echo join( $results, "\n" );
die;
}
break;
default :
do_action( 'wp_ajax_' . $_GET['action'] );
die('0');
break;
endswitch;
endif;
$id = isset($_POST['id'])? (int) $_POST['id'] : 0;
switch ( $action = $_POST['action'] ) :