- forget old ajax wp, now use fetch wp

- trying js files without imports
This commit is contained in:
asus
2024-02-26 13:18:19 +01:00
parent 5794e4cafe
commit 0177531924
11 changed files with 65 additions and 42 deletions

View File

@@ -0,0 +1,12 @@
function PLGNTLS_fetch(url, options = {}) {
console.log("inside PLGNTLS_fetch");
url = PLGNTLS_data.fetch_url + url;
options.headers = options.headers || {};
options.headers['X-WP-Nonce'] = PLGNTLS_data.fetch_nonce,
console.log("options:", options);
return fetch(url, options);
}