[wp-trac] [WordPress Trac] #10334: Multiple Names for One Hook

WordPress Trac wp-trac at lists.automattic.com
Mon Jul 6 21:02:28 UTC 2009


#10334: Multiple Names for One Hook
-----------------------------+----------------------------------------------
 Reporter:  dcole07          |       Owner:  dcole07
     Type:  feature request  |      Status:  new    
 Priority:  normal           |   Milestone:  2.9    
Component:  Taxonomy         |     Version:  2.9    
 Severity:  trivial          |    Keywords:         
-----------------------------+----------------------------------------------

Comment(by dcole07):

 Instead of calling this functionality a hook "synonym" it could be called
 a hook "alias". I used synonym because it was the first thing to come to
 mind.

 The way I set up the code in synonym_filters.php was to create hooks that
 shared the same functions. This, however, might not be the most efficient
 way, since 1) there is an array in which all hooks with aliases list their
 aliases (hook1 list hook 2 and hook 2 lists hook1) and 2) The $wp_filter
 contains copies of each list of functions under each alias. It might be
 better to have a master hook name with other aliases listed under it. That
 way the alias list is smaller (easier to manage and change) and $wp_filter
 doesn't have multiple copies of the same functions. The only downside
 would be not being able to use aliases for do_action and apply_filters,
 but these could possible be worked out by checking who the alias belongs
 to.

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


More information about the wp-trac mailing list