wip trying to create better options to include scripts with attributes

This commit is contained in:
asus
2024-02-27 01:54:46 +01:00
parent 0177531924
commit 81f3f8a7e7
11 changed files with 60 additions and 18 deletions

View File

@@ -0,0 +1,13 @@
//function PLGNTLS_fetch(url, options = {}) {
export 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);
}