Skip to content

Commit

Permalink
Remove wp_enqueue_script versioning (#325)
Browse files Browse the repository at this point in the history
  • Loading branch information
vguerrerobosch authored Nov 17, 2022
1 parent 07cfced commit b0a4fbd
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions public/themes/wordplate/functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,12 @@
wp_get_environment_type() === 'local' &&
is_array(wp_remote_get('http://localhost:5173/')) // is Vite.js running
) {
wp_enqueue_script('vite', 'http://localhost:5173/@vite/client');
wp_enqueue_script('wordplate', 'http://localhost:5173/resources/js/index.js');
wp_enqueue_script('vite', 'http://localhost:5173/@vite/client', [], null);
wp_enqueue_script('wordplate', 'http://localhost:5173/resources/js/index.js', [], null);
} elseif (file_exists($manifestPath)) {
$manifest = json_decode(file_get_contents($manifestPath), true);
wp_enqueue_script('wordplate', get_theme_file_uri('assets/' . $manifest['resources/js/index.js']['file']));
wp_enqueue_style('wordplate', get_theme_file_uri('assets/' . $manifest['resources/js/index.css']['file']));
wp_enqueue_script('wordplate', get_theme_file_uri('assets/' . $manifest['resources/js/index.js']['file']), [], null);
wp_enqueue_style('wordplate', get_theme_file_uri('assets/' . $manifest['resources/js/index.css']['file']), [], null);
}
});

Expand Down

0 comments on commit b0a4fbd

Please sign in to comment.