[wp-hackers] Possible issue in remove_all_filters()

Jacob Santos wordpress at jacobsantos.com
Wed Jul 23 13:33:57 UTC 2014

On line 312 of wp-includes/plugin.php (in my repository version).

if ( false !== $priority && isset( $wp_filter[ $tag ][ $priority ] ) ) {
// reset priority.
} else {
// remove all priorities and reset entire tag.

The issue is that it is possible that $priority will not be false, but that
priority not exist, which will remove all priorities and reset the entire

1: add_filter('some_tag', 'some_function', 1);
2: remove_all_filters('some_tag', 1);

If line 1 is removed at any point, then line 2 will reset the entire
'some_tag' action. This includes priority 10.

Is this the intentional behavior and if so, then why?

Jacob Santos

More information about the wp-hackers mailing list