Skip to content

Instantly share code, notes, and snippets.

@TikiTDO
Last active August 29, 2015 13:56
Show Gist options
  • Save TikiTDO/9142768 to your computer and use it in GitHub Desktop.
Save TikiTDO/9142768 to your computer and use it in GitHub Desktop.
WordPress do_actions profile
<?php
do {
_logt("Start Action Tag: $tag");
_logup();
$t_count = 1;
foreach ( (array) current($wp_filter[$tag]) as $the_ ) {
//$func = $the_['function'];
//if (is_string($func)) _log(" " . $func);
//else _log(' *** ' . get_class($func[0]) . ' ' . $func[1]);
}
foreach ( (array) current($wp_filter[$tag]) as $the_ ) {
$critical_tag = 'wp_loaded';
if ($tag == $critical_tag) {
$func = $the_['function'];
if (is_string($func)) _logt($func);
else _logt('*** ' . get_class($func[0]) . ' ' . $func[1]);
_logup();
}
if ( !is_null($the_['function']) )
call_user_func_array($the_['function'], array_slice($args, 0, (int) $the_['accepted_args']));
if ($tag == $critical_tag) {
_logdown();
_logt('exit');
}
}
_logdown();
_logt("End Tag: $tag");
} while ( next($wp_filter[$tag]) !== false );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment