[wp-trac] [WordPress Trac] #19417: has_filter() can return 0, and remove_filter() doesn't use $accepted_args

WordPress Trac wp-trac at lists.automattic.com
Fri Jul 20 13:54:45 UTC 2012


#19417: has_filter() can return 0, and remove_filter() doesn't use $accepted_args
------------------------------------+---------------------
 Reporter:  nacin                   |       Owner:  nacin
     Type:  defect (bug)            |      Status:  closed
 Priority:  normal                  |   Milestone:  3.5
Component:  Plugins                 |     Version:
 Severity:  normal                  |  Resolution:  fixed
 Keywords:  has-patch commit early  |
------------------------------------+---------------------
Changes (by nacin):

 * owner:   => nacin
 * status:  new => closed
 * resolution:   => fixed


Comment:

 In [21288]:
 {{{
 #!CommitTicketReference repository="" revision="21288"
 Clarify the return value of has_filter() and has_action(). It returns a
 boolean if only the first argument is specified. If the second argument is
 specified, it returns false or an integer, which means it may return a
 non-boolean value that evaluates to false (so, 0), so you should take care
 to use the === operator.

 Correct the function definition of remove_filter() and remove_action(),
 which 'accepted' an $accepted_args argument, but did not require or use
 it.

 fixes #19417.
 }}}

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


More information about the wp-trac mailing list