Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion inc/namespace.php
Original file line number Diff line number Diff line change
Expand Up @@ -230,8 +230,16 @@ function generate_hash_for_asset( WP_Dependencies $dependencies, string $handle
);
}

// Determine version with default version following same logic as core WP_Scripts and WP_Styles.
if ( null === $asset->ver ) {
$version = '';
} else {
$version = $asset->ver ?: $dependencies->default_version;
}

// Generate the hash.
$hash = generate_hash_for_path( $actual_path, $asset->ver );
$hash = generate_hash_for_path( $actual_path, $version );

if ( empty( $hash ) ) {
// Couldn't generate a hash.
return new WP_Error(
Expand Down