Force prototype to load before jquery. Props mdawaffe. fixes #5067 for trunk
git-svn-id: http://svn.automattic.com/wordpress/trunk@6209 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
c698c97198
commit
a8ede71d87
|
@ -421,4 +421,24 @@ function wp_enqueue_script( $handle, $src = false, $deps = array(), $ver = false
|
|||
}
|
||||
$wp_scripts->enqueue( $handle );
|
||||
}
|
||||
|
||||
function wp_prototype_before_jquery( $js_array ) {
|
||||
if ( false === $jquery = array_search( 'jquery', $js_array ) )
|
||||
return $js_array;
|
||||
|
||||
if ( false === $prototype = array_search( 'prototype', $js_array ) )
|
||||
return $js_array;
|
||||
|
||||
if ( $prototype < $jquery )
|
||||
return $js_array;
|
||||
|
||||
unset($js_array[$prototype]);
|
||||
|
||||
array_splice( $js_array, $jquery, 0, 'prototype' );
|
||||
|
||||
return $js_array;
|
||||
}
|
||||
|
||||
add_filter( 'print_scripts_array', 'wp_prototype_before_jquery' );
|
||||
|
||||
?>
|
||||
|
|
Loading…
Reference in New Issue