We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 3cb0586 commit 079ac72Copy full SHA for 079ac72
src/Assets/Asset.php
@@ -1138,11 +1138,10 @@ public function get_full_resource_path( bool $use_min_if_available = true ): str
1138
}
1139
1140
$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
- }
+ $min_path = $min_relative_path === $this->get_path() ? preg_replace( '#(.*).(js|css)#', '$1.min.$2', $path ) : $root_path . $min_relative_path . $resource;
+ $min_path = wp_normalize_path( $min_path );
1144
1145
- return wp_normalize_path( $root_path . $min_relative_path . $resource );
+ return file_exists( $min_path ) ? $min_path : $path;
1146
1147
1148
/**
0 commit comments