$list_class = $_GET['list_args']['class'];
check_ajax_referer( "fetch-list-$list_class", '_ajax_fetch_list_nonce' );
$wp_list_table = _get_list_table( $list_class, array( 'screen' => $_GET['list_args']['screen']['id'] ) );
$list_class = $_GET['list_args']['class'];
check_ajax_referer( "fetch-list-$list_class", '_ajax_fetch_list_nonce' );
$wp_list_table = _get_list_table( $list_class, array( 'screen' => $_GET['list_args']['screen']['id'] ) );
- * @param int $characters The minimum number of characters required. Default 2.
- * @param object $tax The taxonomy object.
- * @param string $s The search term.
+ * @param int $characters The minimum number of characters required. Default 2.
+ * @param WP_Taxonomy $tax The taxonomy object.
+ * @param string $s The search term.
*/
$term_search_min_chars = (int) apply_filters( 'term_search_min_chars', 2, $tax, $s );
*/
$term_search_min_chars = (int) apply_filters( 'term_search_min_chars', 2, $tax, $s );
- $taxonomy = !empty($_POST['taxonomy']) ? $_POST['taxonomy'] : 'post_tag';
- $tax = get_taxonomy($taxonomy);
-
- if ( !current_user_can( $tax->cap->delete_terms ) )
+ if ( ! current_user_can( 'delete_term', $tag_id ) ) {
$tag = get_term( $tag_id, $taxonomy );
if ( !$tag || is_wp_error( $tag ) )
wp_die( 1 );
$tag = get_term( $tag_id, $taxonomy );
if ( !$tag || is_wp_error( $tag ) )
wp_die( 1 );
$names = explode(',', wp_unslash( $_POST['newcat'] ) );
$x = new WP_Ajax_Response();
foreach ( $names as $cat_name ) {
$names = explode(',', wp_unslash( $_POST['newcat'] ) );
$x = new WP_Ajax_Response();
foreach ( $names as $cat_name ) {
check_ajax_referer( 'add-tag', '_wpnonce_add-tag' );
$taxonomy = !empty($_POST['taxonomy']) ? $_POST['taxonomy'] : 'post_tag';
$tax = get_taxonomy($taxonomy);
check_ajax_referer( 'add-tag', '_wpnonce_add-tag' );
$taxonomy = !empty($_POST['taxonomy']) ? $_POST['taxonomy'] : 'post_tag';
$tax = get_taxonomy($taxonomy);
check_ajax_referer( $action );
if ( empty( $post_id ) && ! empty( $_REQUEST['p'] ) ) {
$id = absint( $_REQUEST['p'] );
check_ajax_referer( $action );
if ( empty( $post_id ) && ! empty( $_REQUEST['p'] ) ) {
$id = absint( $_REQUEST['p'] );
check_ajax_referer( 'replyto-comment', '_ajax_nonce-replyto-comment' );
$comment_id = (int) $_POST['comment_ID'];
check_ajax_referer( 'replyto-comment', '_ajax_nonce-replyto-comment' );
$comment_id = (int) $_POST['comment_ID'];
$post_data['post_type'] = $post->post_type;
$post_data['post_status'] = 'draft';
$now = current_time('timestamp', 1);
$post_data['post_type'] = $post->post_type;
$post_data['post_status'] = 'draft';
$now = current_time('timestamp', 1);
$post_data['post_title'] = sprintf( __( 'Draft created on %1$s at %2$s' ), date( __( 'F j, Y' ), $now ), date( __( 'g:i a' ), $now ) );
$pid = edit_post( $post_data );
$post_data['post_title'] = sprintf( __( 'Draft created on %1$s at %2$s' ), date( __( 'F j, Y' ), $now ), date( __( 'g:i a' ), $now ) );
$pid = edit_post( $post_data );
check_ajax_referer( 'taxinlineeditnonce', '_inline_edit' );
$taxonomy = sanitize_key( $_POST['taxonomy'] );
check_ajax_referer( 'taxinlineeditnonce', '_inline_edit' );
$taxonomy = sanitize_key( $_POST['taxonomy'] );
- $wp_list_table = _get_list_table( 'WP_Terms_List_Table', array( 'screen' => 'edit-' . $taxonomy ) );
-
- if ( ! isset($_POST['tax_ID']) || ! ( $id = (int) $_POST['tax_ID'] ) )
+ if ( ! current_user_can( 'edit_term', $id ) ) {
$tag = get_term( $id, $taxonomy );
$_POST['description'] = $tag->description;
$tag = get_term( $id, $taxonomy );
$_POST['description'] = $tag->description;
if ( current_user_can( get_post_type_object( 'attachment' )->cap->read_private_posts ) )
$query['post_status'] .= ',private';
if ( current_user_can( get_post_type_object( 'attachment' )->cap->read_private_posts ) )
$query['post_status'] .= ',private';
- if ( empty( $GLOBALS['wp_press_this'] ) ) {
- include( ABSPATH . 'wp-admin/includes/class-wp-press-this.php' );
- }
-
- $GLOBALS['wp_press_this']->save_post();
+ include( ABSPATH . 'wp-admin/includes/class-wp-press-this.php' );
+ $wp_press_this = new WP_Press_This();
+ $wp_press_this->save_post();
- if ( empty( $GLOBALS['wp_press_this'] ) ) {
- include( ABSPATH . 'wp-admin/includes/class-wp-press-this.php' );
- }
-
- $GLOBALS['wp_press_this']->add_category();
+ include( ABSPATH . 'wp-admin/includes/class-wp-press-this.php' );
+ $wp_press_this = new WP_Press_This();
+ $wp_press_this->add_category();
// Skip creating a new attachment if the attachment is a Site Icon.
if ( get_post_meta( $attachment_id, '_wp_attachment_context', true ) == $context ) {
// Skip creating a new attachment if the attachment is a Site Icon.
if ( get_post_meta( $attachment_id, '_wp_attachment_context', true ) == $context ) {
if ( current_user_can( 'activate_plugins' ) && is_plugin_inactive( $install_status['file'] ) ) {
$status['activateUrl'] = add_query_arg( array(
'_wpnonce' => wp_create_nonce( 'activate-plugin_' . $install_status['file'] ),
'action' => 'activate',
'plugin' => $install_status['file'],
if ( current_user_can( 'activate_plugins' ) && is_plugin_inactive( $install_status['file'] ) ) {
$status['activateUrl'] = add_query_arg( array(
'_wpnonce' => wp_create_nonce( 'activate-plugin_' . $install_status['file'] ),
'action' => 'activate',
'plugin' => $install_status['file'],