Skip to content

Commit

Permalink
correctly exclude jQuery from concatenation when defer JS safe mode i…
Browse files Browse the repository at this point in the history
…s active
  • Loading branch information
remyperona committed Sep 19, 2017
1 parent 724cdc3 commit 248c720
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions inc/functions/options.php
Original file line number Diff line number Diff line change
Expand Up @@ -432,7 +432,7 @@ function get_rocket_exclude_js() {
$js_files = array_unique( array_merge( $js_files, (array) $rocket_excluded_enqueue_js ) );

if ( get_rocket_option( 'defer_all_js', 0 ) && get_rocket_option( 'defer_all_js_safe', 0 ) ) {
$js_files[] = $wp_scripts->registered['jquery-core']->src;
$js_files[] = parse_url( site_url( $wp_scripts->registered['jquery-core']->src), PHP_URL_PATH );
}

/**
Expand Down Expand Up @@ -507,7 +507,7 @@ function get_rocket_exclude_defer_js() {
$exclude_defer_js = array();

if ( get_rocket_option( 'defer_all_js', 0 ) && get_rocket_option( 'defer_all_js_safe', 0 ) ) {
$jquery = $wp_scripts->registered['jquery-core']->src;
$jquery = parse_url( site_url( $wp_scripts->registered['jquery-core']->src ), PHP_URL_PATH );

if ( get_rocket_option( 'remove_query_strings', 0 ) ) {
$jquery = site_url( $jquery . '?ver=' . $wp_scripts->registered['jquery-core']->ver );
Expand Down

0 comments on commit 248c720

Please sign in to comment.