Skip to content

Conversation

@pfefferle
Copy link
Member

Fixes #2730
Fixes #2725

Proposed changes:

  • Add a check to only perform term redirects for supported taxonomies (category and post_tag by default)
  • Add activitypub_supported_taxonomies filter to allow customization
  • Prevents the router from interfering with other plugins (like Polylang) that use term_id for different purposes

Other information:

  • Have you written new tests for your changes, if applicable?

Testing instructions:

For #2730 (Polylang conflict):

  • Install and activate Polylang plugin
  • Try searching the site using /?s=test
  • Verify the search page loads correctly without redirecting to homepage

For #2725 (Posts page redirect):

  • Set a static posts page in Settings → Reading
  • Visit the posts page URL
  • Verify it loads correctly without redirecting to homepage

Changelog entry

  • Automatically create a changelog entry from the details below.
Changelog Entry Details

Significance

  • Patch

Type

  • Fixed - for any bug fixes

Message

Fixed unwanted 301 redirects on search and posts pages when using Polylang or similar plugins.

Copilot AI review requested due to automatic review settings January 8, 2026 11:35
@pfefferle pfefferle self-assigned this Jan 8, 2026
@pfefferle pfefferle requested a review from a team January 8, 2026 11:35
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR addresses unwanted 301 redirects caused by the ActivityPub router interfering with other plugins (like Polylang) that use the term_id query variable for different purposes. The fix adds a taxonomy check to ensure term redirects only occur for supported taxonomies (category and post_tag by default), with a filter to allow customization.

Key Changes:

  • Added taxonomy validation before performing term redirects
  • Introduced activitypub_supported_taxonomies filter for extensibility
  • Prevents conflicts with other plugins using term_id query parameter

Reviewed changes

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

File Description
includes/class-router.php Added taxonomy check in template_redirect() method to limit redirects to supported taxonomies
.github/changelog/fix-router-taxonomy-redirect Added changelog entry documenting the bug fix

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

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

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


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

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

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


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

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

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


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

pfefferle and others added 3 commits January 8, 2026 13:39
- Add tear_down() method for proper test cleanup
- Save filter callbacks to variables for specific removal
- Replace remove_all_filters() with targeted remove_filter() calls
- Fix test_preview_template_filter to properly clean up its filter
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

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


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

@pfefferle pfefferle merged commit f53ccdb into trunk Jan 8, 2026
16 checks passed
@pfefferle pfefferle deleted the fix/router-taxonomy-redirect branch January 8, 2026 17:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Conflict with Polylang plugin causes search to 301 redirect to the homepage 301 redirect of posts page with active activity pub plugin

2 participants