Fix action 'wp_print_footer_scropts' (on the front-end), see #11520

git-svn-id: https://develop.svn.wordpress.org/trunk@18610 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Andrew Ozz 2011-08-26 20:31:30 +00:00
parent 61c8958e4b
commit 83275816df
2 changed files with 16 additions and 11 deletions

View File

@ -214,16 +214,17 @@ add_action( 'wp_head', 'wp_print_styles', 8 );
add_action( 'wp_head', 'wp_print_head_scripts', 9 ); add_action( 'wp_head', 'wp_print_head_scripts', 9 );
add_action( 'wp_head', 'wp_generator' ); add_action( 'wp_head', 'wp_generator' );
add_action( 'wp_head', 'rel_canonical' ); add_action( 'wp_head', 'rel_canonical' );
add_action( 'wp_footer', 'wp_print_footer_scripts' ); add_action( 'wp_footer', 'wp_print_footer_scripts', 20 );
add_action( 'wp_head', 'wp_shortlink_wp_head', 10, 0 ); add_action( 'wp_head', 'wp_shortlink_wp_head', 10, 0 );
add_action( 'template_redirect', 'wp_shortlink_header', 11, 0 ); add_action( 'template_redirect', 'wp_shortlink_header', 11, 0 );
add_action( 'wp_print_footer_scripts', '_wp_footer_scripts' );
if ( isset( $_GET['replytocom'] ) ) if ( isset( $_GET['replytocom'] ) )
add_filter( 'pre_option_blog_public', '__return_zero' ); add_filter( 'pre_option_blog_public', '__return_zero' );
// Login actions // Login actions
add_action( 'login_head', 'wp_print_head_scripts', 9 ); add_action( 'login_head', 'wp_print_head_scripts', 9 );
add_action( 'login_footer', 'wp_print_footer_scripts' ); add_action( 'login_footer', 'wp_print_footer_scripts', 20 );
add_action( 'login_init', 'send_frame_options_header', 10, 0 ); add_action( 'login_init', 'send_frame_options_header', 10, 0 );
// Feed Generator Tags // Feed Generator Tags
@ -244,7 +245,7 @@ add_action( 'do_pings', 'do_all_pings',
add_action( 'do_robots', 'do_robots' ); add_action( 'do_robots', 'do_robots' );
add_action( 'sanitize_comment_cookies', 'sanitize_comment_cookies' ); add_action( 'sanitize_comment_cookies', 'sanitize_comment_cookies' );
add_action( 'admin_print_scripts', 'print_head_scripts', 20 ); add_action( 'admin_print_scripts', 'print_head_scripts', 20 );
add_action( 'admin_print_footer_scripts', 'wp_print_footer_scripts', 20 ); add_action( 'admin_print_footer_scripts', '_wp_footer_scripts' );
add_action( 'admin_print_styles', 'print_admin_styles', 20 ); add_action( 'admin_print_styles', 'print_admin_styles', 20 );
add_action( 'init', 'smilies_init', 5 ); add_action( 'init', 'smilies_init', 5 );
add_action( 'plugins_loaded', 'wp_maybe_load_widgets', 0 ); add_action( 'plugins_loaded', 'wp_maybe_load_widgets', 0 );
@ -284,4 +285,4 @@ add_action( 'admin_color_scheme_picker', 'admin_color_scheme_picker' );
unset($filter, $action); unset($filter, $action);
?> ?>

View File

@ -625,19 +625,23 @@ function wp_print_head_scripts() {
return print_head_scripts(); return print_head_scripts();
} }
/**
* Private, for use in *_footer_scripts hooks
*
* @since 3.3
*/
function _wp_footer_scripts() {
print_late_styles();
print_footer_scripts();
}
/** /**
* Hooks to print the scripts and styles in the footer. * Hooks to print the scripts and styles in the footer.
* *
* @since 2.8 * @since 2.8
*/ */
function wp_print_footer_scripts() { function wp_print_footer_scripts() {
print_late_styles(); do_action('wp_print_footer_scripts');
print_footer_scripts();
if ( !is_admin() )
do_action('wp_print_footer_scripts');
return true;
} }
/** /**