Closed samizarraa closed 6 years ago
Hi Just i want to ask about this line you wrote it in bootstrap file inside your app
'X-CSRF-TOKEN': window.WordPress.csrfToken,
I think it should be like this 'X-WP-Nonce': window.restAPI.nonce, and in theme function file we should add this wp_localize_script( 'app.js', 'restAPI', array( 'nonce' => wp_create_nonce( 'wp_rest' ) ) );
That's right ?
window.WordPress.csrfToken ?! window.WordPress is undefined