Verification for nonce presence on tainacan_blocks variable.

This commit is contained in:
Mateus Machado Luna 2020-03-02 09:44:05 -03:00
parent 4a9734e3b4
commit 31c97a2fe3
1 changed files with 2 additions and 1 deletions

View File

@ -4,6 +4,7 @@ const tainacan = axios.create({
baseURL: tainacan_blocks.root
});
tainacan.defaults.headers.common['X-WP-Nonce'] = tainacan_blocks.nonce;
if (tainacan_blocks.nonce)
tainacan.defaults.headers.common['X-WP-Nonce'] = tainacan_blocks.nonce;
export default tainacan;