now using wp_localize instead of wp_add_inline

This commit is contained in:
asus
2024-02-09 17:53:12 +01:00
parent 35e851cf11
commit 011f0b9c3f
7 changed files with 43 additions and 27 deletions

View File

@@ -30,6 +30,8 @@ include_once(PLUGIN_DIR . '/php/utils/console_log.php');
include_once(PLUGIN_DIR . '/php/utils/add_to_front.php');
include_once(PLUGIN_DIR . '/php/utils/create_html.php');
include_once(PLUGIN_DIR . '/php/menu/menu.php');
@@ -41,16 +43,14 @@ function main_shortcode() {
add_files_to_front( array(
"mystyle.css",
"myscript.js",
"init.js",
"myscript2.js",
"myscript3.js",
));
$myvar_1 = "I am one";
$myvar_2 = "I am two";
# compact creates an array containing the variables and their value
# as key => value
# from an array of variables names as strings
add_var_to_front( compact(
"myvar_1",
"myvar_2",