Uma área de pesquisa sobre o WordPress para devs e autores do tema



wp_prototype_before_jquery ›

Desde2.3.1
Obsoleton/a
wp_prototype_before_jquery ( $js_array )
Parâmetros:
  • (array) $js_array JavaScript scripts array
    Required: Yes
Retorna:
  • (array) Reordered array, if needed.
Definido em:
Codex:

Reorder JavaScript scripts array to place prototype before jQuery.



Fonte

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;
}