Tag template
How To Enqueue A Javascript File In The WordPress Admin
Use the admin_enqueue_scripts hook to load JS in the dashboard. The $hook parameter lets you limit the script to specific admin screens.
How To Register A Gutenberg Block With Plain Javascript In WordPress
You can register a simple block without a build step. Load the script in the editor with the enqueue_block_editor_assets hook and declare the WordPress packages as dependencies.
How To Use The WordPress Rest Api With Javascript Fetch
Expose the REST root URL and a nonce with wp_localize_script(), then call any endpoint from JS.
How To Add Inline Javascript In WordPress With Wp_Add_Inline_Script
Attach a small piece of JS to an already enqueued script. Use 'after' to print it after the script, or 'before' to print it before.
How To Use Jquery Correctly In WordPress
Declare jquery as a dependency and wrap your code in a function. WordPress runs jQuery in noConflict mode, so $ is not available globally.


