Make WordPress Core


Ignore:
Timestamp:
09/24/2013 07:04:21 PM (11 years ago)
Author:
nacin
Message:

Initialize the filter globals.

props rmccue.
fixes #25378.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/plugin.php

    r25476 r25607  
    1919 * @since 1.5
    2020 */
     21
     22// Initialize the filter globals.
     23global $wp_filter, $wp_actions, $merged_filters, $wp_current_filter;
     24
     25if ( ! isset( $wp_filter ) )
     26    $wp_filter = array();
     27
     28if ( ! isset( $wp_actions ) )
     29    $wp_actions = array();
     30
     31if ( ! isset( $merged_filters ) )
     32    $merged_filters = array();
     33
     34if ( ! isset( $wp_current_filter ) )
     35    $wp_current_filter = array();
    2136
    2237/**
     
    372387    global $wp_filter, $wp_actions, $merged_filters, $wp_current_filter;
    373388
    374     if ( ! isset($wp_actions) )
    375         $wp_actions = array();
    376 
    377389    if ( ! isset($wp_actions[$tag]) )
    378390        $wp_actions[$tag] = 1;
     
    436448    global $wp_actions;
    437449
    438     if ( ! isset( $wp_actions ) || ! isset( $wp_actions[$tag] ) )
     450    if ( ! isset( $wp_actions[ $tag ] ) )
    439451        return 0;
    440452
     
    460472function do_action_ref_array($tag, $args) {
    461473    global $wp_filter, $wp_actions, $merged_filters, $wp_current_filter;
    462 
    463     if ( ! isset($wp_actions) )
    464         $wp_actions = array();
    465474
    466475    if ( ! isset($wp_actions[$tag]) )
Note: See TracChangeset for help on using the changeset viewer.