A modular WordPress plugin for managing admin tweaks and client-facing tools. Each tweak is a self-contained PHP file — drop one in, and it appears in the settings UI automatically.
wp-toolkit/
├── plugin.php # Plugin bootstrap
├── inc/
│ ├── class-plugin.php # Settings UI, menu registration
│ ├── class-tweak-loader.php # Loads and validates tweak definitions
│ ├── class-knowledge-base.php
│ ├── knowledge/ # Markdown articles for the knowledge base
│ ├── tweaks/ # Individual tweak files
│ └── zag-filters/ # Zag Filters Bricks module (PHP + built bundle)
├── src/zag-filters/ # Zag Filters frontend source (built with pnpm)
├── scripts/ # Build scripts
├── tests/ # Schema and Zag Filters test suites
└── release.sh # Release automation script
Create a new PHP file in inc/tweaks/ that returns a definition array, then add its slug to ALLOWED_TWEAKS in class-tweak-loader.php.
<?php namespace DDWPTweaks\Tweaks; return [ 'id' => 'ddwpt_my_tweak', // Unique ID, used as option prefix 'label' => 'My Tweak', // Shown in settings UI 'tab' => 'site', // Settings area (optional) 'settings' => [ [ 'id' => 'enabled', // Becomes ddwpt_my_tweak_enabled 'type' => 'checkbox', 'label' => 'Enable tweak', 'description' => 'What this tweak does.', ], ], 'callback' => function ($settings) { if (empty($settings['enabled'])) { return; } // Your tweak logic here. // $settings keys are available both prefixed and unprefixed: // $settings['ddwpt_my_tweak_enabled'] === $settings['enabled'] }, ];
The loader auto-prefixes all setting IDs with the tweak ID, registers them with WordPress, and calls callback on init with the resolved values.
| Type | Notes |
|---|---|
checkbox |
Stored as 1 or '' |
text |
Plain text input |
select |
Requires options array (value => label) |
multiselect |
Requires options array or callable; stored as JSON |
media |
URL string from the WP media picker |
sortable |
Drag-to-reorder list; stored as JSON {order, hidden} |
wysiwyg |
TinyMCE editor |
The settings page groups tweaks into areas (tab) and sections (group): Site, Admin, Content model, Builder, Integrations, SEO, AI & MCP and Settings, with an Overview hub and search (/ or Cmd/Ctrl+K). Omit tab to place a tweak under Site. See docs/settings-layout.md.
Articles are Markdown files in inc/knowledge/. Drop any .md file in and it appears in the knowledge base automatically — no registration needed.
The knowledge base can be displayed as a sidebar page (its own admin menu entry) or as a dashboard panel injected above the widget area, replacing the default WordPress welcome panel. Mode is toggled via the Knowledge Base tweak setting.
Detailed documentation is in docs/:
tweak-system.md— tweak definition format, all field types, areas and sections, settings ID prefixing, callback timingsettings-layout.md: settings page layout (Overview, areas, search, nested pages), tweak layout keys, ability rows, option key migrationsbricks-elements.md— custom element architecture, builder re-render rules, vendored vs CDN policy, Embla Slider referenceknowledge-base.md— adding articles, display modes, manifest structuresettings-export-import.md— export/import behaviour, security model, portability notesai-abilities.md— registered AI abilities, MCP visibility gotchas, whitelist mechanismseo-schema.md— Structured Data (JSON-LD) templates: sources, transforms, directives, editor, SEO plugin conflictsfluent-forms-mirror.md: Fluent Forms Mirror,ff_formCPT for Bricks query loops and popup context, sync triggersbricks-builder-tweaks.md:Bricks_Tagshelper for dynamic tags, extra dynamic tags (reading time, post count, page type), component property groups in Gutenberg, extra HTML tagslinked-author.md: team member as post author,{linked_author:field}tagacf-admin-screens.md: ACF tab error highlighting, tidier term edit screenszag-filters/: Zag Filters, the Zag.js query filter elements for Bricks folded in from the standalone plugin (drop-in replacement, filter impersonation, frontend, build). Per element: select, sorting, smart search, active filters, groupacf-site-options.md: Site Options (Branding & Extras) page, announcement bar timer mode and how it gates the baracf-shopify-products.md: Shopify Product(s) ACF field types, Bricks loop tags, replacing the standalone plugin
The release script handles version bumping, zip packaging, git tagging, and GitHub release creation.
bash release.sh
Requires the gh CLI authenticated and zip installed. The script will prompt for the version bump type and a changelog entry. With pnpm install done, it also rebuilds the Zag Filters bundle and refuses to release a stale one.
Only Zag Filters has a build step; its bundle is committed so a plain checkout works.
pnpm install pnpm build # src/zag-filters/ -> inc/zag-filters/assets/zag-filters.js pnpm test # Zag Filters and schema test suites