diff --git a/wp-admin/includes/ajax-actions.php b/wp-admin/includes/ajax-actions.php index 071514453d..a4835b77e5 100644 --- a/wp-admin/includes/ajax-actions.php +++ b/wp-admin/includes/ajax-actions.php @@ -819,17 +819,20 @@ function wp_ajax_add_tag() { * @since 3.1.0 */ function wp_ajax_get_tagcloud() { - if ( isset( $_POST['tax'] ) ) { - $taxonomy = sanitize_key( $_POST['tax'] ); - $tax = get_taxonomy( $taxonomy ); - if ( ! $tax ) - wp_die( 0 ); - if ( ! current_user_can( $tax->cap->assign_terms ) ) - wp_die( -1 ); - } else { + if ( ! isset( $_POST['tax'] ) ) { wp_die( 0 ); } + $taxonomy = sanitize_key( $_POST['tax'] ); + $tax = get_taxonomy( $taxonomy ); + if ( ! $tax ) { + wp_die( 0 ); + } + + if ( ! current_user_can( $tax->cap->assign_terms ) ) { + wp_die( -1 ); + } + $tags = get_terms( $taxonomy, array( 'number' => 45, 'orderby' => 'count', 'order' => 'DESC' ) ); if ( empty( $tags ) ) diff --git a/wp-includes/version.php b/wp-includes/version.php index df17fe8fcd..4e5f512984 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -4,7 +4,7 @@ * * @global string $wp_version */ -$wp_version = '4.1-alpha-30167'; +$wp_version = '4.1-alpha-30168'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.