Skip to content

Instantly share code, notes, and snippets.

@KnowTheCodePro
Created March 30, 2016 03:16
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 KnowTheCodePro/f34316153cf32545e3cd980a823e6dbb to your computer and use it in GitHub Desktop.
Save KnowTheCodePro/f34316153cf32545e3cd980a823e6dbb to your computer and use it in GitHub Desktop.
WordPress Docx do_action - Callback Loop Refactored
$priority_level_callbacks = (array) current( $wp_filter[$tag] );
do {
foreach ( (array) $priority_level_callbacks as $the_ ) {
if ( ! is_null( $the_['function'] ) ) {
call_user_func_array( $the_['function'], array_slice( $args, 0, (int) $the_['accepted_args'] ) );
}
}
$priority_level_callbacks = (array) next( $wp_filter[$tag] );
} while ( $priority_level_callbacks !== false );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment