WordPress.org

Make WordPress Core

Changes between Version 1 and Version 2 of Ticket #16031, comment 97


Ignore:
Timestamp:
10/13/16 17:06:52 (14 months ago)
Author:
ericlewis
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #16031, comment 97

    v1 v2  
    22> These should either be statically named hooks, or a better way of clearly passing different formats and number of data to the hooks is needed. 
    33 
    4 We can't statically name the hooks in the current implementation, as some of the hooks are covering multiple screens. eg. the [https://github.com/WordPress/WordPress/blob/acd764a1d3e599797a5d875f5721f76f81638cf9/wp-admin/edit.php#L178 edit.php handle_bulk_actions-* hook] invokes `handle_bulk_actions-edit-post`, `handle_bulk_actions-edit-page` and ``handle_bulk_actions-my-custom-post-type`.  
     4We can't statically name the hooks in the current implementation, as some of the hooks are covering multiple screens. eg. the [https://github.com/WordPress/WordPress/blob/acd764a1d3e599797a5d875f5721f76f81638cf9/wp-admin/edit.php#L178 edit.php handle_bulk_actions-* hook] invokes `handle_bulk_actions-edit-post`, `handle_bulk_actions-edit-page` and `handle_bulk_actions-my-custom-post-type`.  
    55 
    66If we want statically named hooks here, perhaps we could change all hooks to use a single hook, `handle_bulk_actions`, and expect developers to perform the screen check in their callback. Since different screens will include different contextual data, perhaps we consolidate it in an array in a `$context` argument. eg.