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:
parent
a5f43eaf65
commit
4c3ffc92f7
|
@ -37,7 +37,9 @@ if ( ! is_user_logged_in() ) {
|
||||||
die('-1');
|
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' ) )
|
if ( !current_user_can( 'manage_categories' ) )
|
||||||
die('-1');
|
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 . "%')" );
|
$results = $wpdb->get_col( "SELECT name FROM $wpdb->terms WHERE name LIKE ('%". $s . "%')" );
|
||||||
echo join( $results, "\n" );
|
echo join( $results, "\n" );
|
||||||
die;
|
die;
|
||||||
}
|
break;
|
||||||
|
default :
|
||||||
|
do_action( 'wp_ajax_' . $_GET['action'] );
|
||||||
|
die('0');
|
||||||
|
break;
|
||||||
|
endswitch;
|
||||||
|
endif;
|
||||||
|
|
||||||
$id = isset($_POST['id'])? (int) $_POST['id'] : 0;
|
$id = isset($_POST['id'])? (int) $_POST['id'] : 0;
|
||||||
switch ( $action = $_POST['action'] ) :
|
switch ( $action = $_POST['action'] ) :
|
||||||
|
|
Loading…
Reference in New Issue