[wp-trac] [WordPress Trac] #25433: do_action( 'do_meta_boxes' ) is a redundant hook

WordPress Trac noreply at wordpress.org
Sun Sep 29 03:47:00 UTC 2013


#25433: do_action( 'do_meta_boxes' ) is a redundant hook
----------------------------+------------------------------
 Reporter:  ericlewis       |       Owner:
     Type:  defect (bug)    |      Status:  new
 Priority:  normal          |   Milestone:  Awaiting Review
Component:  Administration  |     Version:
 Severity:  normal          |  Resolution:
 Keywords:  dev-feedback    |
----------------------------+------------------------------

Comment (by nacin):

 I'm actually not sure how redundant it is. add_meta_boxes is for *adding*
 meta boxes. do_meta_boxes is designed to let people manipulate the
 registered meta boxes once they are registered but before they are
 rendered.

 Normally, we'd just suggest a later priority on the hook, and not
 introduce a second hook. But, these particular hooks are well established.
 And we do occasionally implement hooks to fire immediately after (or
 before, depending) a particularly popular/common hook to make it less of a
 juggle with priorities. For example, wp_loaded after init,
 admin_enqueue_scripts before admin_print_scripts.

 It might not be obvious at first, but it's pretty easy to explain why
 things moved in [9620]. Basically, that commit was the start of "Screen
 Options", which is rendered as part of the admin header. (It wasn't
 originally there as you can tell; that commit moved it there, but its
 introduction was also in the same development cycle, which was 2.7.) So,
 it became necessary for do_meta_boxes to be called earlier, to make sure
 that any manipulations were properly reflected in screen options.

 As #13017 explains, maybe we shouldn't have set this up this way. But we
 don't really have many "deprecated" hooks, and certainly not one that's
 this popular.

--
Ticket URL: <http://core.trac.wordpress.org/ticket/25433#comment:2>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list