mirror of
https://github.com/WordPress/WordPress.git
synced 2025-01-22 16:21:26 +01:00
Allow ['action'] in admin-ajax.php. Props misterbisson. fixes #7945
git-svn-id: http://svn.automattic.com/wordpress/trunk@9281 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
ef44f75f79
commit
2d2c0736e3
@ -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
Block a user