Tag hook
How To Create A Custom Rest Api Endpoint In WordPress
The WordPress REST API lets you create your own URLs that return JSON. They are useful for mobile apps, JavaScript widgets and connecting external services. Register routes with register_rest_route() on…
How To Register A Custom Post Type In WordPress
A custom post type, or CPT, is a new type of content besides posts and pages, such as portfolio items, products, events or testimonials. Register it with register_post_type() on the…
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 Enqueue A Javascript File In WordPress
Use wp_enqueue_script() inside the wp_enqueue_scripts hook to load your JS file the right way.


