Content controls
setCopyBtn adds paragraph copy actions, while setImgLazyLoadingWhenDomReady marks matching images for lazy loading.
TypeScript utilities for adding copy buttons, lazy-loading images, adapting WordPress headers and sidebars, checking URLs, and sizing images.
npm install mazey-wordpress-utils The public API operates on caller-provided selectors and the current browser document. It remains separate from the documentation website.
setCopyBtn adds paragraph copy actions, while setImgLazyLoadingWhenDomReady marks matching images for lazy loading.
hideHeaderInTOC and hideSidebar adapt existing markup when their documented conditions match.
isIncludeInUrl checks the current location, and setImgWidthHeight applies URL dimensions through page-provided jQuery.
Install the package in a browser-oriented project. Its runtime dependencies remain external in the Rollup package output.
npm install mazey-wordpress-utilsImport supported helpers from the package root, then call them after the page DOM is available.
Read the complete typed API documentationimport {
hideSidebar,
setImgLazyLoadingWhenDomReady
} from "mazey-wordpress-utils";
setImgLazyLoadingWhenDomReady(".site-content");
hideSidebar({
urlContainList: ["hide_sidebar"],
primarySelector: "#primary",
secondarySelector: "#secondary"
});The playground runs URL, lazy-image, and sidebar helpers against visible WordPress-style example markup.
Supported browsers may offer installation for offline access to the project home, playground shell, and API documentation. Availability depends on the browser and platform.