~canonical-sysadmins/wordpress/3.9.x

« back to all changes in this revision

Viewing changes to wp-includes/plugin.php

  • Committer: Paul Collins
  • Date: 2011-07-13 02:31:10 UTC
  • Revision ID: paul.collins@canonical.com-20110713023110-rvp7cjj31rsaomkr
import Wordpress 3.2

Show diffs side-by-side

added added

removed removed

Lines of Context:
135
135
        global $wp_filter, $merged_filters, $wp_current_filter;
136
136
 
137
137
        $args = array();
138
 
        $wp_current_filter[] = $tag;
139
138
 
140
139
        // Do 'all' actions first
141
140
        if ( isset($wp_filter['all']) ) {
 
141
                $wp_current_filter[] = $tag;
142
142
                $args = func_get_args();
143
143
                _wp_call_all_hook($args);
144
144
        }
145
145
 
146
146
        if ( !isset($wp_filter[$tag]) ) {
147
 
                array_pop($wp_current_filter);
 
147
                if ( isset($wp_filter['all']) )
 
148
                        array_pop($wp_current_filter);
148
149
                return $value;
149
150
        }
150
151
 
 
152
        if ( !isset($wp_filter['all']) )
 
153
                $wp_current_filter[] = $tag;
 
154
 
151
155
        // Sort
152
156
        if ( !isset( $merged_filters[ $tag ] ) ) {
153
157
                ksort($wp_filter[$tag]);
193
197
function apply_filters_ref_array($tag, $args) {
194
198
        global $wp_filter, $merged_filters, $wp_current_filter;
195
199
 
196
 
        $wp_current_filter[] = $tag;
197
 
 
198
200
        // Do 'all' actions first
199
201
        if ( isset($wp_filter['all']) ) {
 
202
                $wp_current_filter[] = $tag;
200
203
                $all_args = func_get_args();
201
204
                _wp_call_all_hook($all_args);
202
205
        }
203
206
 
204
207
        if ( !isset($wp_filter[$tag]) ) {
205
 
                array_pop($wp_current_filter);
 
208
                if ( isset($wp_filter['all']) )
 
209
                        array_pop($wp_current_filter);
206
210
                return $args[0];
207
211
        }
208
212
 
 
213
        if ( !isset($wp_filter['all']) )
 
214
                $wp_current_filter[] = $tag;
 
215
 
209
216
        // Sort
210
217
        if ( !isset( $merged_filters[ $tag ] ) ) {
211
218
                ksort($wp_filter[$tag]);
360
367
        else
361
368
                ++$wp_actions[$tag];
362
369
 
363
 
        $wp_current_filter[] = $tag;
364
 
 
365
370
        // Do 'all' actions first
366
371
        if ( isset($wp_filter['all']) ) {
 
372
                $wp_current_filter[] = $tag;
367
373
                $all_args = func_get_args();
368
374
                _wp_call_all_hook($all_args);
369
375
        }
370
376
 
371
377
        if ( !isset($wp_filter[$tag]) ) {
372
 
                array_pop($wp_current_filter);
 
378
                if ( isset($wp_filter['all']) )
 
379
                        array_pop($wp_current_filter);
373
380
                return;
374
381
        }
375
382
 
 
383
        if ( !isset($wp_filter['all']) )
 
384
                $wp_current_filter[] = $tag;
 
385
 
376
386
        $args = array();
377
387
        if ( is_array($arg) && 1 == count($arg) && isset($arg[0]) && is_object($arg[0]) ) // array(&$this)
378
388
                $args[] =& $arg[0];
446
456
        else
447
457
                ++$wp_actions[$tag];
448
458
 
449
 
        $wp_current_filter[] = $tag;
450
 
 
451
459
        // Do 'all' actions first
452
460
        if ( isset($wp_filter['all']) ) {
 
461
                $wp_current_filter[] = $tag;
453
462
                $all_args = func_get_args();
454
463
                _wp_call_all_hook($all_args);
455
464
        }
456
465
 
457
466
        if ( !isset($wp_filter[$tag]) ) {
458
 
                array_pop($wp_current_filter);
 
467
                if ( isset($wp_filter['all']) )
 
468
                        array_pop($wp_current_filter);
459
469
                return;
460
470
        }
461
471
 
 
472
        if ( !isset($wp_filter['all']) )
 
473
                $wp_current_filter[] = $tag;
 
474
 
462
475
        // Sort
463
476
        if ( !isset( $merged_filters[ $tag ] ) ) {
464
477
                ksort($wp_filter[$tag]);