File tree Expand file tree Collapse file tree 1 file changed +5
-4
lines changed
Expand file tree Collapse file tree 1 file changed +5
-4
lines changed Original file line number Diff line number Diff line change @@ -3571,18 +3571,19 @@ static function () use ( $placeholder ) {
35713571 * swap out _wp_footer_scripts() with an alternative which captures the printed styles (for hoisting to HEAD) before
35723572 * proceeding with printing the footer scripts.
35733573 */
3574- $ wp_footer_priority = has_action ( 'wp_print_footer_scripts ' , '_wp_footer_scripts ' );
3575- if ( false === $ wp_footer_priority || false === has_action ( 'wp_footer ' , 'wp_print_footer_scripts ' ) ) {
3574+ $ wp_print_footer_scripts_priority = has_action ( 'wp_print_footer_scripts ' , '_wp_footer_scripts ' );
3575+ if ( false === $ wp_print_footer_scripts_priority || false === has_action ( 'wp_footer ' , 'wp_print_footer_scripts ' ) ) {
35763576 // The normal priority for wp_print_footer_scripts() is to run at 20.
35773577 add_action ( 'wp_footer ' , $ capture_late_styles , 20 );
35783578 } else {
3579- remove_action ( 'wp_print_footer_scripts ' , '_wp_footer_scripts ' );
3579+ remove_action ( 'wp_print_footer_scripts ' , '_wp_footer_scripts ' , $ wp_print_footer_scripts_priority );
35803580 add_action (
35813581 'wp_print_footer_scripts ' ,
35823582 static function () use ( $ capture_late_styles ) {
35833583 $ capture_late_styles ();
35843584 print_footer_scripts ();
3585- }
3585+ },
3586+ $ wp_print_footer_scripts_priority
35863587 );
35873588 }
35883589
You can’t perform that action at this time.
0 commit comments