Skip to content

Docs: replace rewrite-flushing writeFile examples - #3806

Open
ekamran wants to merge 1 commit into
WordPress:trunkfrom
ekamran:shifteq/fix-writefile-docs-rewrite-flush
Open

Docs: replace rewrite-flushing writeFile examples#3806
ekamran wants to merge 1 commit into
WordPress:trunkfrom
ekamran:shifteq/fix-writefile-docs-rewrite-flush

Conversation

@ekamran

@ekamran ekamran commented Jun 17, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Replace writeFile examples that flushed rewrite rules on every request with harmless mu-plugin examples
  • Fix the writeFile documentation link to use the generated WriteFileStep anchor
  • Update the theme guide to reference the body-class example merged in Remove stale rewrite flush from theme demo blueprint blueprints#220
  • Simplify the standalone example by removing unnecessary networking and opening it in wp-admin

Fixes #2195

Testing

  • git diff --check
  • npx prettier --check packages/docs/site/docs/blueprints/08-examples.md packages/docs/site/docs/main/guides/for-theme-developers.md
  • npx nx build docs-site
  • GitHub Actions passed on the latest commit

The docs build still reports existing TypeDoc/Docusaurus warnings unrelated to this change.

@ekamran
ekamran requested review from a team and brandonpayton June 17, 2026 19:14
@github-actions github-actions Bot added the [Type] Documentation Improvements or additions to documentation label Jun 17, 2026
Comment thread packages/docs/site/docs/main/guides/for-theme-developers.md Outdated
Comment thread packages/docs/site/docs/main/guides/for-theme-developers.md Outdated

@bgrgicak bgrgicak left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for starting this PR @ekamran! I left a couple of comments.

@brandonpayton brandonpayton left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @ekamran, I left more review notes for this PR. Thank you!

Comment thread packages/docs/site/docs/main/guides/for-theme-developers.md
Comment thread packages/docs/site/docs/blueprints/08-examples.md Outdated
Copilot AI review requested due to automatic review settings July 11, 2026 10:04

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Note

Copilot was unable to run its full agentic suite in this review.

Updates documentation examples to avoid flushing rewrite rules on every request, replacing them with safer mu-plugin examples and aligning guidance with Playground’s permalink setup behavior.

Changes:

  • Replaced rewrite-rule flushing writeFile examples with harmless mu-plugin snippets (body class / admin footer text).
  • Updated the blueprint example landing page to /wp-admin/ and simplified steps.
  • Adjusted writeFile step documentation reference.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.

File Description
packages/docs/site/docs/main/guides/for-theme-developers.md Replaces rewrite flushing mu-plugin example with a demo body class example; updates writeFile link.
packages/docs/site/docs/blueprints/08-examples.md Replaces rewrite flushing mu-plugin example with an admin footer customization example; updates landing page.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread packages/docs/site/docs/main/guides/for-theme-developers.md Outdated
Comment thread packages/docs/site/docs/blueprints/08-examples.md Outdated
Comment thread packages/docs/site/docs/blueprints/08-examples.md Outdated
@ekamran

ekamran commented Jul 11, 2026

Copy link
Copy Markdown
Contributor Author

Updated the mu-plugin wording to avoid the a/an confusion. I kept the writeFile link as it is because the direct step anchors are already reported as broken in the docs build.

Comment thread packages/docs/site/docs/main/guides/for-theme-developers.md
bgrgicak pushed a commit to WordPress/blueprints that referenced this pull request Jul 16, 2026
## Summary

- Remove the stale `rewrite.php` mu-plugin example that calls
`flush_rules()`.
- Use a small `writeFile` example that adds a demo body class instead.
- Switch the Kanso theme source to `git:directory` so PR Blueprint
validation accepts the external source.
- Point the WXR import to this branch raw URL for PR validation.

## Dependency

This supports WordPress/wordpress-playground#3806. Once this PR lands,
that Playground docs PR can keep the Run Blueprint link pointing to
Blueprints `trunk`.

cc @bgrgicak based on the review direction in
WordPress/wordpress-playground#3806.

## Testing

- `git diff --check`
- `GITHUB_BRANCH='remove-theme-demo-flush-rules'
CHANGED_FILES='blueprints/install-activate-setup-theme-from-gh-repo/blueprint.json'
npm run validate:pr-blueprints`
@ekamran
ekamran force-pushed the shifteq/fix-writefile-docs-rewrite-flush branch from cd63881 to b1c36ab Compare July 16, 2026 12:46

@bgrgicak bgrgicak left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for working on this @ekamran!

@bgrgicak
bgrgicak requested a review from brandonpayton July 16, 2026 13:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

[Type] Documentation Improvements or additions to documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Docs: Example for blueprint step writeFile flushes permalink rewrites rules on every page load

4 participants