From b1c00f2653af51ac2f3b0ff6f2eb89f1b138f05b Mon Sep 17 00:00:00 2001 From: Scott Taylor Date: Sun, 23 Aug 2015 16:28:28 +0000 Subject: [PATCH] Posts List Table: Don't show bulk actions if the user can't edit posts. Props DrewAPicture. Fixes #29789. Built from https://develop.svn.wordpress.org/trunk@33713 git-svn-id: http://core.svn.wordpress.org/trunk@33680 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-admin/includes/class-wp-posts-list-table.php | 5 +++++ wp-includes/version.php | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/wp-admin/includes/class-wp-posts-list-table.php b/wp-admin/includes/class-wp-posts-list-table.php index 24d9e0f90c..0e55c6372c 100644 --- a/wp-admin/includes/class-wp-posts-list-table.php +++ b/wp-admin/includes/class-wp-posts-list-table.php @@ -282,6 +282,11 @@ class WP_Posts_List_Table extends WP_List_Table { $actions = array(); $post_type_obj = get_post_type_object( $this->screen->post_type ); + // Don't show bulk options if the user can't edit posts. + if ( ! current_user_can( $post_type_obj->cap->edit_posts ) ) { + return $actions; + } + if ( $this->is_trash ) { $actions['untrash'] = __( 'Restore' ); } else { diff --git a/wp-includes/version.php b/wp-includes/version.php index c8d3bf7faf..b0f1ec330a 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -4,7 +4,7 @@ * * @global string $wp_version */ -$wp_version = '4.4-alpha-33712'; +$wp_version = '4.4-alpha-33713'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.