bulk_actions-{$this->screen->id} WordPress Action Hook

The bulk_actions-{$this->screen->id} hook is used to modify the bulk actions menu for a specific screen. This hook is typically used to add or remove bulk actions for a custom post type or taxonomy.

apply_filters( "bulk_actions-{$this->screen->id}", array $actions ) #

Filters the items in the bulk actions menu of the list table.


Description

The dynamic portion of the hook name, $this->screen->id, refers to the ID of the current screen.


Top ↑

Parameters

$actions

(array)An array of the available bulk actions.


Top ↑

More Information

  • This hook allows you to remove items from the bulk actions dropdown on any specified admin screen.
  • Bulk actions are a simple associative array.
  • The filter hook follows the format ‘bulk_actions-screenid‘, where screenid is the id of the admin screen that you want to affect.
  • As of version 4.7, custom bulk actions can be added using this filter. You can add functionality to custom bulk actions using ‘handle_bulk_actions-screenid‘, where screenid is the id of the admin screen that you want to affect.

Top ↑

Source

File: wp-admin/includes/class-wp-list-table.php

View on Trac



Top ↑

Changelog

Changelog
VersionDescription
5.6.0A bulk action can now contain an array of options in order to create an optgroup.
3.1.0Introduced.

The content displayed on this page has been created in part by processing WordPress source code files which are made available under the GPLv2 (or a later version) license by theĀ Free Software Foundation. In addition to this, the content includes user-written examples and information. All material is subject to review and curation by the WPPaste.com community.