GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - DylanDuff/wp-toolkit: Tweaks for a bunch of parts of WordPress that annoy me

BranchesTags
Open more actions menu

Latest commit

 

History

160 Commits
160 Commits

Folders and files

NameName
Last commit message
Last commit date
.github/workflows
.github/workflows
 
 
assets
assets
 
 
docs
docs
 
 
inc
inc
 
 
plugin-update-checker
plugin-update-checker
 
 
scripts
scripts
 
 
src/zag-filters
src/zag-filters
 
 
tests
tests
 
 
.gitignore
.gitignore
 
 
.npmrc
.npmrc
 
 
.oxlintrc.json
.oxlintrc.json
 
 
CLAUDE.md
CLAUDE.md
 
 
README.md
README.md
 
 
package.json
package.json
 
 
plugin.php
plugin.php
 
 
pnpm-lock.yaml
pnpm-lock.yaml
 
 
release.sh
release.sh
 
 

Repository files navigation

WP Toolkit

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.


Structure

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

Adding a Tweak

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.

Available field types

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

Areas

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.


Knowledge Base

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.


Developer Reference

Detailed documentation is in docs/:

  • tweak-system.md — tweak definition format, all field types, areas and sections, settings ID prefixing, callback timing
  • settings-layout.md: settings page layout (Overview, areas, search, nested pages), tweak layout keys, ability rows, option key migrations
  • bricks-elements.md — custom element architecture, builder re-render rules, vendored vs CDN policy, Embla Slider reference
  • knowledge-base.md — adding articles, display modes, manifest structure
  • settings-export-import.md — export/import behaviour, security model, portability notes
  • ai-abilities.md — registered AI abilities, MCP visibility gotchas, whitelist mechanism
  • seo-schema.md — Structured Data (JSON-LD) templates: sources, transforms, directives, editor, SEO plugin conflicts
  • fluent-forms-mirror.md: Fluent Forms Mirror, ff_form CPT for Bricks query loops and popup context, sync triggers
  • bricks-builder-tweaks.md: Bricks_Tags helper for dynamic tags, extra dynamic tags (reading time, post count, page type), component property groups in Gutenberg, extra HTML tags
  • linked-author.md: team member as post author, {linked_author:field} tag
  • acf-admin-screens.md: ACF tab error highlighting, tidier term edit screens
  • zag-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, group
  • acf-site-options.md: Site Options (Branding & Extras) page, announcement bar timer mode and how it gates the bar
  • acf-shopify-products.md: Shopify Product(s) ACF field types, Bricks loop tags, replacing the standalone plugin

Releasing

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.

Building

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

About

Tweaks for a bunch of parts of WordPress that annoy me

Resources

Readme
Activity

Stars

0 stars

Watchers

0 watching

Forks

0 forks
Report repository

Releases

Packages

Contributors

Languages

You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.