Load a JavaScript Module Only Where It Is Needed
Registers a native JavaScript module with WordPress's Script Modules API and loads it only on pages that contain a chosen block, so modern ES module code needs no bundler and costs nothing elsewhere.
Snippet Library
Snippets for developers: debugging helpers, custom cron schedules, body classes, REST API tweaks and admin tools for checking hooks and queries. Building blocks for people who write code for WordPress every day.
Registers a native JavaScript module with WordPress's Script Modules API and loads it only on pages that contain a chosen block, so modern ES module code needs no bundler and costs nothing elsewhere.
Enqueues a JavaScript or CSS file only on the pages you list, instead of on every page, to keep the rest of the site fast.
Prints a small window.siteSettings object with the home URL, REST API root, AJAX URL, language and, for logged-in users, a REST nonce, so your custom JavaScript never hard-codes addresses.