[wp-trac] [WordPress Trac] #29070: Calling remove_all_filters() causes has_filter() with no $function_to_check to always return true

WordPress Trac noreply at wordpress.org
Sat Aug 2 14:23:09 UTC 2014


#29070: Calling remove_all_filters() causes has_filter() with no $function_to_check
to always return true
------------------------------------------+--------------------
 Reporter:  pseudoxiah                    |       Owner:
     Type:  defect (bug)                  |      Status:  new
 Priority:  normal                        |   Milestone:  4.0
Component:  Plugins                       |     Version:  trunk
 Severity:  normal                        |  Resolution:
 Keywords:  needs-patch needs-unit-tests  |     Focuses:
------------------------------------------+--------------------

Comment (by jacklenox):

 Isn't this the expected behaviour? `remove_all_filters()` removes all of
 the hooks from a filter, but not the filter itself.

 So, having run `remove_all_filters()`, if I ran `has_filter()` without a
 function to check, I'd still expect it to return `true`.

 Having said this, I'm actually a bit confused. I'm running trunk locally
 (up-to-date), and for me it's returning `false` under the circumstances
 above…

 http://codex.wordpress.org/Function_Reference/has_filter
 http://codex.wordpress.org/Function_Reference/remove_all_filters

--
Ticket URL: <https://core.trac.wordpress.org/ticket/29070#comment:2>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list