Plugin Directory

Changeset 645847


Ignore:
Timestamp:
12/29/2012 04:37:55 PM (13 years ago)
Author:
misternifty
Message:

Removed anonymous functions to work with PHP 5.2. Moved logging of current_filter() from extensions to main file

Location:
debug-this/trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • debug-this/trunk/_inc/extensions.php

    r645549 r645847  
    6262        add_debug_extension('wp_query', __('WP_Query'), __('Current WP_Query object - global $wp_query', 'debug-this'), array($this, 'wp_query'), 'Query');
    6363        add_debug_extension('help', __('Debug This Menu', 'debug-this'), __('Modes Navigation', 'debug-this'), array($this, 'help'));
    64         add_action('all', function(){
    65             global $debug_this_current_filter;
    66             $debug_this_current_filter[] = current_filter();
    67         });
    6864    }
    6965
  • debug-this/trunk/debug-this.php

    r645281 r645847  
    5353            && !is_admin()
    5454        ){
     55            add_action('all', array($this, 'log_current_filters_and_actions'));
    5556            add_filter('template_include', array($this, 'template_include'), 90210, 1);
    5657            add_filter('template_redirect', array($this, 'buffer_page'), 90210);
     
    178179    }
    179180
    180 }
    181 add_action('init', function(){new Debug_This;});
     181    public function log_current_filters_and_actions(){
     182        global $debug_this_current_filter;
     183        $debug_this_current_filter[] = current_filter();
     184    }
     185
     186}
     187add_action('init', 'debug_this_init');
     188function debug_this_init(){
     189    new Debug_This;
     190}
    182191
    183192function add_debug_extension($id, $name, $description, $callback, $group = 'General'){
Note: See TracChangeset for help on using the changeset viewer.