[wp-trac] [WordPress Trac] #14671: Deprecate the "accepted args" argument in add_filter() and add_action()

WordPress Trac wp-trac at lists.automattic.com
Mon Aug 23 14:00:50 UTC 2010


#14671: Deprecate the "accepted args" argument in add_filter() and add_action()
-------------------------+--------------------------------------------------
 Reporter:  markjaquith  |       Owner:     
     Type:  enhancement  |      Status:  new
 Priority:  normal       |   Milestone:  3.1
Component:  Plugins      |     Version:     
 Severity:  normal       |    Keywords:     
-------------------------+--------------------------------------------------

Comment(by markjaquith):

 Replying to [comment:7 jacobsantos]:
 >  Function A accepts 3 parameters with 3rd being optional.
 >
 >  The programmer wishes to use this same function for two or more
 filters, but wants to specify different behavior when the 3rd parameter is
 set.

 That's what {{{current_filter()}}} is for. It's much more powerful than
 going on the number of parameters passed.

 We considered this, but thought that it was both an edge case and an
 instance of sloppy coding (why do that when we have a function that tells
 you exactly which hook is being run?)

 > @mark: re the php built-in functions I'd take the view that we replace
 trim and so forth with custom wrappers where necessary.

 I don't think it's that much work to support internal PHP functions,
 either using the exhaustive method I provided, or just enumerating common
 use cases. There aren't that many that are ever used. Or, we could mark as
 deprecated the use of internal PHP functions, while still supporting them
 for a while.

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


More information about the wp-trac mailing list