[wp-trac] [WordPress Trac] #24429: Provide a way to deprecate and/or rename hooks

WordPress Trac noreply at wordpress.org
Mon May 27 03:33:42 UTC 2013


#24429: Provide a way to deprecate and/or rename hooks
-------------------------+-----------------------------
 Reporter:  ryanve       |      Owner:
     Type:  enhancement  |     Status:  new
 Priority:  normal       |  Milestone:  Awaiting Review
Component:  Plugins      |    Version:
 Severity:  normal       |   Keywords:
-------------------------+-----------------------------
 It would be useful for themes/plugins/core to have a way to rename a hook
 with a another hook, such that when `add_filter($tag, $fn)` is called, the
 `$tag` is replaced with another tag. Syntactically, maybe:

 - `rename_filter($old_tag, $replacement_tag)`
 - `deprecate_filter($old_tag, $optional_replacement_tag)`

 Or `$tag` could be made filterable as `add_filter` is called. This would
 add a lot of capabilities:

 {{{
 if ( ! apply_filters('add_filter_args', func_get_args()))
     return false;
 }}}

 Or, still many capabilities, and safer:

 {{{
 if (false === apply_filters('hook_tag', $tag, $fn, $priority, $accept)
     return false;
 }}}

 Consider: #23259

--
Ticket URL: <http://core.trac.wordpress.org/ticket/24429>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list