refactor: Set the version for the resource file in WordPress.

This commit is contained in:
LamGC 2023-06-05 13:52:18 +08:00
parent bd1895f79b
commit 857ca2c411
Signed by: LamGC
GPG Key ID: 6C5AE2A913941E1D

View File

@ -10,8 +10,9 @@ Author URI: https://blog.lamgc.moe
License: GNU GENERAL PUBLIC LICENSE Version 3.0 License: GNU GENERAL PUBLIC LICENSE Version 3.0
*/ */
const PLUGIN_VERSION = "0.1.0";
const ASCIIPLAYER_TAG = "asciiplayer"; const ASCIIPLAYER_TAG = "asciiplayer";
const ASCIIPLAYER_VERSION = '3.4.0';
// 是否使用本地资源, 如果可以的话, 建议使用 CDN. // 是否使用本地资源, 如果可以的话, 建议使用 CDN.
add_option("ap_use_local_resources", false); add_option("ap_use_local_resources", false);
@ -71,10 +72,14 @@ function load_scripts()
wp_enqueue_script( wp_enqueue_script(
'asciiplayer-adapter-js', 'asciiplayer-adapter-js',
plugin_dir_url(__FILE__) . '/asciiplayer/dist/bundle.js', plugin_dir_url(__FILE__) . '/asciiplayer/dist/bundle.js',
array(),
PLUGIN_VERSION
); );
wp_enqueue_style( wp_enqueue_style(
'asciiplayer-adapter-css', 'asciiplayer-adapter-css',
plugin_dir_url(__FILE__) . '/asciiplayer/dist/styles.css', plugin_dir_url(__FILE__) . '/asciiplayer/dist/styles.css',
array(),
PLUGIN_VERSION
); );
} }
} }