Created
April 24, 2013 06:26
-
-
Save joeldbirch/5450036 to your computer and use it in GitHub Desktop.
WordPress snippet to make FooBox's initialisation code appear last in the source order. Ensures FooBox assets are present prior to initialisation code running, preventing errors.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function fix_foobox_initialisation() { | |
remove_action('wp_print_footer_scripts', array($GLOBALS['foobox'], 'inline_dynamic_js') ); | |
add_action('wp_footer', array($GLOBALS['foobox'], 'inline_dynamic_js'), 99999 ); | |
} | |
add_action('wp', 'fix_foobox_initialisation'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment