Skip to content
This repository has been archived by the owner on Feb 23, 2024. It is now read-only.

Commit

Permalink
Fix loading deps when WordPress is installed in a subdir #6500
Browse files Browse the repository at this point in the history
Fix loading deps when WordPress is installed in a subdir
  • Loading branch information
gigitux committed Jul 11, 2022
1 parent 3bc4499 commit 5548ab1
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/BlockTypes/MiniCart.php
Original file line number Diff line number Diff line change
Expand Up @@ -276,8 +276,12 @@ protected function append_script_and_deps_src( $script ) {
if ( ! $script->src ) {
return;
}

$site_url = get_site_url();
$path = wp_parse_url( $site_url )['path'] ?? '';

$this->scripts_to_lazy_load[ $script->handle ] = array(
'src' => $script->src,
'src' => wp_http_validate_url( $script->src ) ? $script->src : $path . $script->src,
'version' => $script->ver,
'before' => $wp_scripts->print_inline_script( $script->handle, 'before', false ),
'after' => $wp_scripts->print_inline_script( $script->handle, 'after', false ),
Expand Down

0 comments on commit 5548ab1

Please sign in to comment.