Skip to content

Instantly share code, notes, and snippets.

@itsananderson
Created June 10, 2012 06:32
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save itsananderson/2904167 to your computer and use it in GitHub Desktop.
Save itsananderson/2904167 to your computer and use it in GitHub Desktop.
Filter everything in WordPress and output it
<?php
// add_action( 'all', array( __CLASS__, 'filter_it' ) );
// add_action( 'wp_redirect', array( __CLASS__, 'die_it' ) );
// static $actions = array();
public static function filter_it() {
$args = func_get_args();
self::$actions[] = $args;
}
public static function output_it() {
foreach ( self::$actions as $action ) {
self::pre_print_r( $action );
}
}
public static function die_it() {
self::output_it();
die();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment