How to load plugin before the wordpress jquery?

1.0.0? Really?! Anyway you could try the print_scripts_array filter:

// Hack of wp_prototype_before_jquery() in "wp-includes/script-loader.php"
function wpse157295_print_scripts_array( $js_array ) {
    if ( false === $jquery = array_search( 'jquery-core', $js_array, true ) ) // Now 'jquery-core', not 'jquery'
        return $js_array;

    $keys = array( 'jquery.min', 'highcharts', 'exporting' );

    foreach ( $keys as $key ) {
        if ( ( $idx = array_search( $key, $js_array, true ) ) && $idx >= $jquery ) {

            unset($js_array[$idx]);

            array_splice( $js_array, $jquery, 0, $key );
        }
    }

    return $js_array;
}
add_filter( 'print_scripts_array', 'wpse157295_print_scripts_array' );

Leave a Comment