wp_prototype_before_jquery( string[] $js_array )
Reorders JavaScript scripts array to place prototype before jQuery.
Parameters
- $js_array
-
(Required) JavaScript scripts array
Return
(string[]) Reordered array, if needed.
Source
File: wp-includes/script-loader.php
function wp_prototype_before_jquery( $js_array ) {
if ( false === $prototype = array_search( 'prototype', $js_array, true ) )
return $js_array;
if ( false === $jquery = array_search( 'jquery', $js_array, true ) )
return $js_array;
if ( $prototype < $jquery )
return $js_array;
unset($js_array[$prototype]);
array_splice( $js_array, $jquery, 0, 'prototype' );
return $js_array;
}
Changelog
Version | Description |
---|---|
2.3.1 | Introduced. |