handle_bulk_actions-(screen_id) хук-фильтрWP 4.7.0

Fires when a custom bulk action should be handled.

The redirect link should be modified with success or failure feedback from the action to be used to display feedback to the user.

The dynamic portion of the hook name, $screen, refers to the current screen ID.

Использование

add_filter( 'handle_bulk_actions-(screen_id)', 'wp_kama_handle_bulk_actions_screen_id_filter', 10, 3 );

/**
 * Function for `handle_bulk_actions-(screen_id)` filter-hook.
 * 
 * @param string $sendback The redirect URL.
 * @param string $doaction The action being taken.
 * @param array  $items    The items to take the action on. Accepts an array of IDs of posts, comments, terms, links, plugins, attachments, or users.
 *
 * @return string
 */
function wp_kama_handle_bulk_actions_screen_id_filter( $sendback, $doaction, $items ){

	// filter...
	return $sendback;
}
$sendback(строка)
The redirect URL.
$doaction(строка)
The action being taken.
$items(массив)
The items to take the action on. Accepts an array of IDs of posts, comments, terms, links, plugins, attachments, or users.

Список изменений

С версии 4.7.0 Введена.

Где вызывается хук

В файле: /wp-admin/edit.php
handle_bulk_actions-(screen_id)
wp-admin/edit.php 222
$sendback = apply_filters( "handle_bulk_actions-{$screen}", $sendback, $doaction, $post_ids ); // phpcs:ignore WordPress.NamingConventions.ValidHookName.UseUnderscores
wp-admin/users.php 590
$sendback = apply_filters( "handle_bulk_actions-{$screen}", $sendback, $wp_list_table->current_action(), $user_ids ); // phpcs:ignore WordPress.NamingConventions.ValidHookName.UseUnderscores
wp-admin/plugins.php 545
$sendback = apply_filters( "handle_bulk_actions-{$screen}", $sendback, $action, $plugins ); // phpcs:ignore WordPress.NamingConventions.ValidHookName.UseUnderscores
wp-admin/upload.php 344
$location = apply_filters( "handle_bulk_actions-{$screen}", $location, $doaction, $post_ids ); // phpcs:ignore WordPress.NamingConventions.ValidHookName.UseUnderscores
wp-admin/edit-comments.php 120
$redirect_to = apply_filters( "handle_bulk_actions-{$screen}", $redirect_to, $doaction, $comment_ids ); // phpcs:ignore WordPress.NamingConventions.ValidHookName.UseUnderscores
wp-admin/edit-tags.php 207
$location = apply_filters( "handle_bulk_actions-{$screen}", $location, $wp_list_table->current_action(), $tags ); // phpcs:ignore WordPress.NamingConventions.ValidHookName.UseUnderscores
wp-admin/link-manager.php 38
$redirect_to = apply_filters( "handle_bulk_actions-{$screen}", $redirect_to, $doaction, $bulklinks ); // phpcs:ignore WordPress.NamingConventions.ValidHookName.UseUnderscores

Где используется хук в WordPress

Использование не найдено.