﻿id	summary	reporter	owner	description	type	status	priority	milestone	component	version	severity	resolution	keywords	cc	focuses	prnumber
44484	Mediaelement scripts forced loaded in header	Themezly	joemcgill	"Before this https://make.wordpress.org/core/2017/10/30/mediaelement-upgrades-in-wordpress-4-9/

media element scripts were loading where called 

example:



{{{
wp_enqueue_script( 'wp-mediaelement' ); // loads above site-scripts in footer with dependencies 

/*
mediaelement-and-player.min.js
wp-mediaelement.min.js
*/

wp_enqueue_script( 'site-scripts'); // loads in footer as needed
}}}

now 

mediaelement.min.js
mediaelement-core.min.js 

load in head and wp-mediaelement.min.js loads in footer 

If I call them one by one without calling wp-mediaelement the order is kept


{{{
wp_enqueue_script( 'mediaelement-migrate' );// loads in footer
wp_enqueue_script( 'mediaelement-core' );// loads in footer
wp_enqueue_script( 'site-scripts'); // loads in footer
}}}


if you look here it is intended for all of them to be in footer

https://github.com/WordPress/WordPress/blob/6a9a5e123c49862babf664367c26c89499fed4e0/wp-includes/script-loader.php#L377-L378

https://github.com/WordPress/WordPress/blob/6a9a5e123c49862babf664367c26c89499fed4e0/wp-includes/script-loader.php#L474

but wp_enqueue_script( 'wp-mediaelement' ); 

depends on  wp_enqueue_script( 'mediaelement' );  http://prntscr.com/k15288

https://github.com/WordPress/WordPress/blob/6a9a5e123c49862babf664367c26c89499fed4e0/wp-includes/script-loader.php#L376

which loads in header only


so we can never move the scripts to footer where they should be

If I set the mediaelement to load in footer everything works as intended."	defect (bug)	closed	normal	5.3	Media	4.9.6	major	fixed	has-patch		performance	
