Ticket #17110: apply_filters.diff

File apply_filters.diff, 793 bytes (added by ryan, 2 years ago)
Line 
1Index: wp-includes/plugin.php
2===================================================================
3--- wp-includes/plugin.php      (revision 17631)
4+++ wp-includes/plugin.php      (working copy)
5@@ -135,19 +135,23 @@
6        global $wp_filter, $merged_filters, $wp_current_filter;
7 
8        $args = array();
9-       $wp_current_filter[] = $tag;
10 
11        // Do 'all' actions first
12        if ( isset($wp_filter['all']) ) {
13+               $wp_current_filter[] = $tag;
14                $args = func_get_args();
15                _wp_call_all_hook($args);
16        }
17 
18        if ( !isset($wp_filter[$tag]) ) {
19-               array_pop($wp_current_filter);
20+               if ( isset($wp_filter['all']) )
21+                       array_pop($wp_current_filter);
22                return $value;
23        }
24 
25+       if ( !isset($wp_filter['all']) )
26+               $wp_current_filter[] = $tag;
27+
28        // Sort
29        if ( !isset( $merged_filters[ $tag ] ) ) {
30                ksort($wp_filter[$tag]);