Make WordPress Core


Ignore:
Timestamp:
12/03/2019 01:56:25 PM (5 years ago)
Author:
SergeyBiryukov
Message:

Docs: Move the canonical DocBlock for handle_bulk_actions-{$screen} action to wp-admin/edit.php.

  • Document accepted values for the $items parameter.
  • Use interpolated syntax for the filter name.

Props dilipbheda, johnbillion, SergeyBiryukov.
Fixes #48857.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/edit.php

    r45932 r46811  
    183183            break;
    184184        default:
    185             /** This action is documented in wp-admin/edit-comments.php */
    186             $sendback = apply_filters( 'handle_bulk_actions-' . get_current_screen()->id, $sendback, $doaction, $post_ids ); // phpcs:ignore WordPress.NamingConventions.ValidHookName.UseUnderscores
     185            $screen = get_current_screen()->id;
     186
     187            /**
     188             * Fires when a custom bulk action should be handled.
     189             *
     190             * The redirect link should be modified with success or failure feedback
     191             * from the action to be used to display feedback to the user.
     192             *
     193             * The dynamic portion of the hook name, `$screen`, refers to the current screen ID.
     194             *
     195             * @since 4.7.0
     196             *
     197             * @param string $sendback The redirect URL.
     198             * @param string $doaction The action being taken.
     199             * @param array  $items    The items to take the action on. Accepts an array of IDs of posts,
     200             *                         comments, terms, links, plugins, attachments, or users.
     201             */
     202            $sendback = apply_filters( "handle_bulk_actions-{$screen}", $sendback, $doaction, $post_ids ); // phpcs:ignore WordPress.NamingConventions.ValidHookName.UseUnderscores
    187203            break;
    188204    }
Note: See TracChangeset for help on using the changeset viewer.