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

@@ -0,0 +1,4 @@
const title = document.querySelector(".first_el_to_change");
title.innerHTML = "--- coucou ;) " + php_data.myvar_1;
console.log(php_data.myvar_1);

View File

@@ -1,5 +0,0 @@
const title = document.querySelector(".first_el_to_change");
title.innerHTML = "--- coucou ;)";
console.log("myvar_1: " + myvar_1);

View File

@@ -1,4 +1,3 @@
const title2 = document.querySelector(".second_el_to_change");
title2.innerHTML = "--- ho boy !";

View File

@@ -1,5 +1,4 @@
const title3 = document.querySelector(".third_el_to_change");
title3.innerHTML = "--- bye bye";
console.log("myvar_2: " + myvar_2);
title3.innerHTML = "--- bye bye, " + php_data.myvar_2;
console.log(php_data.myvar_2);