wpseek.com
Un motore di ricerca WordPress per sviluppatori e autori di temi



wp_prototype_before_jquery › WordPress Function

Da2.3.1
Deprecaton/a
wp_prototype_before_jquery ( $js_array )
Parametri:
  • (string[]) $js_array JavaScript scripts array
    Richiesto:
Ritorna:
  • (string[]) Reordered array, if needed.
Definito a:
Codex:

Reorders JavaScript scripts array to place prototype before jQuery.



Sorgenti

function wp_prototype_before_jquery( $js_array ) {
	$prototype = array_search( 'prototype', $js_array, true );

	if ( false === $prototype ) {
		return $js_array;
	}

	$jquery = array_search( 'jquery', $js_array, true );

	if ( false === $jquery ) {
		return $js_array;
	}

	if ( $prototype < $jquery ) {
		return $js_array;
	}

	unset( $js_array[ $prototype ] );

	array_splice( $js_array, $jquery, 0, 'prototype' );

	return $js_array;
}