Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
3.2. Localize Route and Create Nonce
<?php
function localize_route() {
wp_localize_script( 'initiative-tracker-frontend-script', 'initTracker', [
'route' => 'rave-initiative/v1/initiative',
] );
}
add_action( 'wp_enqueue_scripts', 'localize_route' );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment