[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 11:25:27 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 Denis-de-Bernardy):

 Replying to [comment:7 jacobsantos]:
 > I guess I need to explain. The backwards compatibility I was describing
 had nothing to with passing more parameters than the function definition
 supports, but really had to do with passing less parameters than the
 function supports.
 >
 >  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.

 I considered raising the same issue (I occasionally do this), but I then
 felt that the cost of myself adding an extra function to work around it
 was quite tiny. It's much tinier than me wasting my time needing to
 remember to pass ghat 3rd argument anyway...

 @mark: re the php built-in functions I'd take the view that we replace
 trim and so forth with custom wrappers where necessary. And then let WP
 complain or crash: doing so will make missing function args or extra
 passed args easier to track.

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


More information about the wp-trac mailing list