diff --git a/public/themes/wordplate/header.php b/public/themes/wordplate/header.php index 225fbbf8..e4ec827d 100644 --- a/public/themes/wordplate/header.php +++ b/public/themes/wordplate/header.php @@ -7,14 +7,13 @@ - - + + - - - + + diff --git a/src/helpers.php b/src/helpers.php index a255a417..b9791321 100644 --- a/src/helpers.php +++ b/src/helpers.php @@ -33,3 +33,17 @@ function env(string $key, mixed $default = null): mixed return $value; } } + +if (!function_exists('get_asset_file_uri')) { + function get_asset_file_uri(string $file = ''): string + { + $path = get_theme_file_path('assets/' . $file); + $url = get_theme_file_uri('assets/' . $file); + + if (file_exists($path)) { + return $url . '?v=' . hash('fnv1a32', (string) filemtime($path)); + } + + return $url; + } +}