Possible issue in remove_all_filters()

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view

Possible issue in remove_all_filters()

Jacob Santos-3
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
wp-hackers mailing list
[hidden email]