Skip to content

Instantly share code, notes, and snippets.

@jakubmikita
Created March 25, 2018 13:31
Show Gist options
  • Save jakubmikita/a4b7e013477f162b5504f1e360e934b8 to your computer and use it in GitHub Desktop.
Save jakubmikita/a4b7e013477f162b5504f1e360e934b8 to your computer and use it in GitHub Desktop.
Saving all the executed actions during WordPress call
add_action( 'shutdown', function() {
foreach( $GLOBALS['wp_actions'] as $action => $count ) {
$action = sprintf( '%s (%d)', $action, $count );
file_put_contents( dirname( __FILE__ ) . '/actions.log', print_r( $action, true ) . "\r\n", FILE_APPEND );
}
} );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment