Files
2024_WEBSITE_fipf/plugins/cipf_plugin/utils/plgntls_fetch.js
2024-03-24 16:06:47 +01:00

24 lines
468 B
JavaScript

/*
* this file is there for scripts that uses modules import
*
*/
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;
return fetch(url, options);
}
/*
* For non-module scripts, attach to the global scope
*
*/
if (typeof window !== 'undefined') {
window.PLGNTLS_fetch = PLGNTLS_fetch;
}