Skip to content

Instantly share code, notes, and snippets.

@a1iraxa
Forked from thefuxia/all-actions-list.php
Created November 28, 2018 07:17
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 a1iraxa/3d249f26f00024c2cc01b521c4a91a6c to your computer and use it in GitHub Desktop.
Save a1iraxa/3d249f26f00024c2cc01b521c4a91a6c to your computer and use it in GitHub Desktop.
Plugin All Actions List
<?php # -*- coding: utf-8 -*-
/*
Plugin Name: All Actions List
Description: Lists all actions run during one request.
Version: 1.0
Required: 3.1
Author: Thomas Scholz
Author URI: http://toscho.de
License: GPL
*/
! defined( 'ABSPATH' ) and exit;
add_action( 'all', 'aal_handler', 99999, 99 );
function aal_handler()
{
static $list = array ();
$exclude = array ( 'gettext', 'gettext_with_context' );
$action = current_filter();
$args = func_get_args();
if ( ! in_array( $action, $exclude ) )
{
$list[] = $action;
}
// shutdown is the last action
if ( 'shutdown' == $action )
{
print '<pre>' . implode( "\n", $list ) . '</pre>';
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment