Skip to content

Document runnable code examples in DocBlocks - #163

Open
adamziel wants to merge 4 commits into
WordPress:masterfrom
adamziel:docs/runnable-code-examples
Open

Document runnable code examples in DocBlocks#163
adamziel wants to merge 4 commits into
WordPress:masterfrom
adamziel:docs/runnable-code-examples

Conversation

@adamziel

@adamziel adamziel commented Sep 4, 2026

Copy link
Copy Markdown

Adds runnable PHP example guidance directly to the PHP Documentation Standards page. It documents the php interactive fence, // Outputs formats, and setup Blueprints used by the Code Reference.

Background

The PHP documentation standards already explain indented examples, but do not describe the opt-in syntax for examples that readers can run in WordPress Playground. This belongs with the PHP DocBlock rules, where authors already look for example guidance.

This change

  • Adds a Runnable examples subsection to inline-documentation-standards/php.md, directly after Description.
  • Documents the fence rules, code requirements, output forms, legacy-fence guidance, and hidden setup examples.
  • Keeps the feature opt-in, so existing indented examples continue to work unchanged.
  • Does not add a separate handbook page or sidebar item.

Testing

  • Ran git diff --check.
  • Parsed manifest.json and checked the PHP page placement, links, and Markdown fence pairs with a small validation script.

@sirreal

sirreal commented Sep 4, 2026

Copy link
Copy Markdown
Member

https://make.wordpress.org/core/2026/09/04/runnable-code-examples-are-now-live-in-the-code-reference/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants