Definition:
function wp_prototype_before_jquery( $js_array ) {}
Reorder JavaScript scripts array to place prototype before jQuery.
Parameters
- array $js_array: JavaScript scripts array
Return values
returns:Reordered array, if needed.
Source code
function wp_prototype_before_jquery( $js_array ) {
if ( false === $jquery = array_search( 'jquery', $js_array, true ) )
return $js_array;
if ( false === $prototype = array_search( 'prototype', $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;
}
4007

February 12, 2011 


No comments yet... Be the first to leave a reply!