Skip to content

Commit 079ac72

Browse files
committed
Fixing my bugs
1 parent 3cb0586 commit 079ac72

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

src/Assets/Asset.php

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1138,11 +1138,10 @@ public function get_full_resource_path( bool $use_min_if_available = true ): str
11381138
}
11391139

11401140
$min_relative_path = $this->get_min_path();
1141-
if ( $min_relative_path === $resource_path ) {
1142-
return preg_replace( '#(.*).(js|css)#', '$1.min.$2', $path );
1143-
}
1141+
$min_path = $min_relative_path === $this->get_path() ? preg_replace( '#(.*).(js|css)#', '$1.min.$2', $path ) : $root_path . $min_relative_path . $resource;
1142+
$min_path = wp_normalize_path( $min_path );
11441143

1145-
return wp_normalize_path( $root_path . $min_relative_path . $resource );
1144+
return file_exists( $min_path ) ? $min_path : $path;
11461145
}
11471146

11481147
/**

0 commit comments

Comments
 (0)