Plugin Documentation – WordPress Plugin Boilerplate
Use the docs/ folder for all plugin documentation. Organize files and subfolders in any structure that fits the project.
Structure Is Flexible
Section titled “Structure Is Flexible”Group documentation by feature, workflow, or integration. Create subfolders when it helps discovery, and keep filenames descriptive so they can be linked directly from the project README or other docs. Author docs as MDX so components can be used when helpful.
Keep Overview Docs in Sync
Section titled “Keep Overview Docs in Sync”When you add, rename, or significantly expand docs, update the overview docs that help people discover them:
docs/index.mdxas the docs landing page- the project README
AGENTS.mdif present- the unified
wp-plugin-bpskill routing and references in.agents/skills/wp-plugin-bp/
Front Matter Metadata
Section titled “Front Matter Metadata”Front matter is optional, and documentation can be created freely. Using it is a best practice; when you include it, add a title, a short_title, and a description so automated tooling can parse the docs.
---title: Asset Bundlingshort_title: Bundlingdescription: How scripts and styles are built and enqueued.---Headings and Intro
Section titled “Headings and Intro”Do not repeat the front matter title as an H1 in the body. Start with a short paragraph or an H2 such as ## Overview.
---title: Asset Bundlingshort_title: Bundlingdescription: How scripts and styles are built and enqueued.---
Short intro paragraph.
## Overview...Code Blocks
Section titled “Code Blocks”Use Expressive Code attributes on fenced code blocks. These attributes are ignored when unsupported, so it is best practice to include them consistently.
- Always specify a language for syntax highlighting (e.g.
bash,php,js). - Add a
title="..."when the snippet belongs to a file or a terminal session.
npm run buildprivate function enqueue_entrypoint( string $entry, array $localize_data = array() ): voidFolder Structures
Section titled “Folder Structures”When documenting folder layouts, use the Starlight FileTree component so directories and files render consistently.
import { FileTree } from '@astrojs/starlight/components';
<FileTree>- src - ...</FileTree>