changed plugin name to cipf
This commit is contained in:
22
plugins/cipf_plugin/utils/plgntls_fetch.js
Normal file
22
plugins/cipf_plugin/utils/plgntls_fetch.js
Normal file
@@ -0,0 +1,22 @@
|
||||
|
||||
/**
|
||||
* 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,
|
||||
console.log("options:", options);
|
||||
|
||||
return fetch(url, options);
|
||||
}
|
||||
|
||||
/**
|
||||
* For non-module scripts, attach to the global scope
|
||||
*/
|
||||
if (typeof window !== 'undefined') {
|
||||
window.PLGNTLS_fetch = PLGNTLS_fetch;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user