This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // php file | |
| function enqueue_scripts() { | |
| wp_enqueue_script( 'public-js', plugin_dir_url( __FILE__ ) . 'js/script.js', array(), '1.0', true ); | |
| wp_localize_script( 'public-js', 'localizeObj', | |
| [ | |
| 'ajax_url' => admin_url( 'admin-ajax.php' ), | |
| 'nonce' => wp_create_nonce( 'prefix_public_nonce' ), | |
| ] | |
| ); | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Show hidden characters
| { | |
| // This file is required for VSCode to understand webpack aliases | |
| "module": "es6", | |
| "moduleResolution": "node", | |
| "compilerOptions": { | |
| "resolveJsonModule": true, | |
| "jsx": "preserve", | |
| "module": "commonjs", | |
| "target": "es5", | |
| "sourceMap": true, |