[wp-trac] [WordPress Trac] #14280: add_filter should accept an array of tags

WordPress Trac noreply at wordpress.org
Wed Oct 9 07:26:18 UTC 2013


#14280: add_filter should accept an array of tags
-------------------------------------------------+-------------------------
 Reporter:  sivel                                |       Owner:
     Type:  enhancement                          |      Status:  closed
 Priority:  normal                               |   Milestone:
Component:  Plugins                              |     Version:
 Severity:  normal                               |  Resolution:  wontfix
 Keywords:  has-patch early needs-testing dev-   |
  feedback                                       |
-------------------------------------------------+-------------------------

Comment (by nacin):

 Replying to [comment:10 joehoyle]:
 > So  many plugins do the above with `add_action( 'init', 'my_plugin_init'
 );` that doesn't make sense to be a function. It's not reusable, it's not
 meant to be added / remove by third parties, so probably shouldn't be
 added as a top level function. Without closures you end up loads of once-
 use weirdly named internal functions for callbacks, making it much more
 difficult to have the codebase coherent.

 So, I certainly see where this sentiment is coming from, and am inclined
 to agree. But I'm not sure it scales well beyond a single hook. Once you
 need to attach the same callback/closure to multiple hooks, I think that's
 generally a really good indicator that we've crossed (or at least
 approached) the point of reusability.

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


More information about the wp-trac mailing list