mazey-wordpress-utils

TypeScript utilities for adding copy buttons, lazy-loading images, adapting WordPress headers and sidebars, checking URLs, and sizing images.

npm install mazey-wordpress-utils

Focused helpers for live WordPress pages

The public API operates on caller-provided selectors and the current browser document. It remains separate from the documentation website.

Content controls

setCopyBtn adds paragraph copy actions, while setImgLazyLoadingWhenDomReady marks matching images for lazy loading.

Layout adaptation

hideHeaderInTOC and hideSidebar adapt existing markup when their documented conditions match.

URL and image helpers

isIncludeInUrl checks the current location, and setImgWidthHeight applies URL dimensions through page-provided jQuery.

Install

Install the package in a browser-oriented project. Its runtime dependencies remain external in the Rollup package output.

npm install mazey-wordpress-utils

Usage

Import supported helpers from the package root, then call them after the page DOM is available.

Read the complete typed API documentation
import {
  hideSidebar,
  setImgLazyLoadingWhenDomReady
} from "mazey-wordpress-utils";

setImgLazyLoadingWhenDomReady(".site-content");

hideSidebar({
  urlContainList: ["hide_sidebar"],
  primarySelector: "#primary",
  secondarySelector: "#secondary"
});

Try the public root API

The playground runs URL, lazy-image, and sidebar helpers against visible WordPress-style example markup.

Open the live playground

Install the documentation website

Supported browsers may offer installation for offline access to the project home, playground shell, and API documentation. Availability depends on the browser and platform.