Skip to content

Test/random post type priority - #15959

Closed
aaronjorbin wants to merge 22 commits into
WordPress:trunkfrom
aaronjorbin:test/random-post-type-priority
Closed

aaronjorbin wants to merge 22 commits into
WordPress:trunkfrom
aaronjorbin:test/random-post-type-priority

Conversation

@aaronjorbin

Copy link
Copy Markdown
Member

Ensures rewrite rules added to the top, including post type and taxonomy rules, take precedence over random content rules using the same regex.

This is a continuation of #15838 but pulling in trunk lead to conflicts that I resolved manually. Instead of force pushing to @peterwilsoncc's branch, i created my one.

Trac ticket: https://core.trac.wordpress.org/ticket/66630

Use of AI Tools
AI assistance: Yes
Tool(s): Claude
Model(s): Fable 5.2
Used for: Code, tests, running code on test box. Reviewed and manually tested by me prior to marking this PR ready for review.

This Pull Request is for code review only. Please keep all other discussion in the Trac ticket. Do not merge this Pull Request. See GitHub Pull Requests for Code Review in the Core Handbook for more details.

peterwilsoncc and others added 22 commits November 12, 2026 15:39
Co-authored-by: Aaron Jorbin <aaronjorbin@users.noreply.github.com>
Co-authored-by: Aaron Jorbin <aaronjorbin@users.noreply.github.com>
Co-authored-by: Aaron Jorbin <aaronjorbin@users.noreply.github.com>
Use a single data provider for the post type archive and single post
tests, including the cases from each. The single post test now checks
the permalink against the post type's rewrite slug, as the archive only
case does not place single posts at the random base.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
@github-actions

Copy link
Copy Markdown

The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs.

Core Committers: Use this line as a base for the props when committing in SVN:

Props peterwilsoncc, jorbin.

To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook.


Props Bot commands

You can trigger Props Bot actions by commenting on this PR:

  • @propsbot add <username> to give props to a GitHub or WordPress.org user. Requires write access.
  • @propsbot remove <username> to leave a user out of the props. Requires write access.
  • @propsbot refresh to refresh this list. Adding the props-bot label works too.

@github-actions

Copy link
Copy Markdown

Test using WordPress Playground

The changes in this pull request can previewed and tested using a WordPress Playground instance.

WordPress Playground is an experimental project that creates a full WordPress instance entirely within the browser.

Some things to be aware of

  • All changes will be lost when closing a tab with a Playground instance.
  • All changes will be lost when refreshing the page.
  • A fresh instance is created each time the link below is clicked.
  • Every time this pull request is updated, a new ZIP file containing all changes is created. If changes are not reflected in the Playground instance,
    it's possible that the most recent build failed, or has not completed. Check the list of workflow runs to be sure.

For more details about these limitations and more, check out the Limitations page in the WordPress Playground documentation.

Test this pull request with WordPress Playground.

wporg-sync pushed a commit that referenced this pull request Nov 12, 2026
…les.

A post type whose archive is at the random base, by name, rewrite slug or `has_archive`, kept its rewrite rule but had the rule's query replaced by the random content query. As a result `/random/` either redirected to random content or returned a 404 instead of displaying the post type archive. The same applied to any rule a plugin added to the top using the same regex as a random content rule.

Random content rules using the same regex as a rule added to the top, including post type and taxonomy rules, are now omitted when the rewrite rules are generated.

Developed in: #15959 and #15838

Follow-up to r64402.

Props peterwilsoncc, jorbin, ssebuwufumoses, aryanjasala.
Fixes #66630. See #64498.


git-svn-id: https://develop.svn.wordpress.org/trunk@65441 602fd350-edb4-49c9-b593-d223f7449a82
@github-actions

Copy link
Copy Markdown

A commit was made that fixes the Trac ticket referenced in the description of this pull request.

SVN changeset: 65441
GitHub commit: 6872cd4

This PR will be closed, but please confirm the accuracy of this and reopen if there is more work to be done.

@github-actions github-actions Bot closed this Nov 12, 2026
wporg-sync pushed a commit to WordPress/WordPress that referenced this pull request Nov 12, 2026
…les.

A post type whose archive is at the random base, by name, rewrite slug or `has_archive`, kept its rewrite rule but had the rule's query replaced by the random content query. As a result `/random/` either redirected to random content or returned a 404 instead of displaying the post type archive. The same applied to any rule a plugin added to the top using the same regex as a random content rule.

Random content rules using the same regex as a rule added to the top, including post type and taxonomy rules, are now omitted when the rewrite rules are generated.

Developed in: WordPress/wordpress-develop#15959 and WordPress/wordpress-develop#15838

Follow-up to r64402.

Props peterwilsoncc, jorbin, ssebuwufumoses, aryanjasala.
Fixes #66630. See #64498.

Built from https://develop.svn.wordpress.org/trunk@65441


git-svn-id: http://core.svn.wordpress.org/trunk@64580 1a063a9b-81f0-0310-95a4-ce76da25c4cd
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