From fa0584e23680302e69c1a6208de60545ad05cf12 Mon Sep 17 00:00:00 2001 From: Andrew Nacin Date: Fri, 14 Jan 2011 07:20:13 +0000 Subject: [PATCH] Prevent new bulk actions from being added through the bulk_actions-screen filter. fixes #16031 at least for 3.1. git-svn-id: https://develop.svn.wordpress.org/trunk@17297 602fd350-edb4-49c9-b593-d223f7449a82 --- wp-admin/includes/class-wp-list-table.php | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/wp-admin/includes/class-wp-list-table.php b/wp-admin/includes/class-wp-list-table.php index fd4cf8df88..65d5403196 100644 --- a/wp-admin/includes/class-wp-list-table.php +++ b/wp-admin/includes/class-wp-list-table.php @@ -264,11 +264,12 @@ class WP_List_Table { $screen = get_current_screen(); if ( is_null( $this->_actions ) ) { - $this->_actions = $this->get_bulk_actions(); + $no_new_actions = $this->_actions = $this->get_bulk_actions(); + // This filter can currently only be used to remove actions. $this->_actions = apply_filters( 'bulk_actions-' . $screen->id, $this->_actions ); + $this->_actions = array_intersect_key( $this->_actions, $no_new_actions ); $two = ''; - } - else { + } else { $two = '2'; }