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

WordPress Trac noreply at wordpress.org
Thu May 30 18:51:18 UTC 2013


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

Comment (by alex-ye):

 Replying to [comment:37 westonruter]:
 > No, it will not break. See the code in the patch checks to see how many
 arguments that the `esc_url` function accepts via the Reflection API, and
 it will pass in as many arguments from the `apply_filters` call as the
 supplied filter function accepts.

 I think that the use of Reflection API here will downgrade the
 performance.

 As you see esc_url can accept 3 arguments and we use the first only in
 most cases. The thing I don't want to happen is to pass $post_id as
 $protocols.

 Instead of deprecate the "accepted args" I love to see an ability to pass
 -1 to indicate that the function can accept any args count.

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


More information about the wp-trac mailing list