From dcbe9ba65d4d1f8979a3d884b7d05d52dc271f76 Mon Sep 17 00:00:00 2001 From: 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: http://svn.automattic.com/wordpress/trunk@17297 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- 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'; }