-
Notifications
You must be signed in to change notification settings - Fork 83
Limit term redirect to supported taxonomies #2734
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this 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_taxonomiesfilter for extensibility - Prevents conflicts with other plugins using
term_idquery 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.
There was a problem hiding this 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.
There was a problem hiding this 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.
There was a problem hiding this 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.
Co-authored-by: Copilot <[email protected]>
- 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
There was a problem hiding this 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.
Fixes #2730
Fixes #2725
Proposed changes:
categoryandpost_tagby default)activitypub_supported_taxonomiesfilter to allow customizationterm_idfor different purposesOther information:
Testing instructions:
For #2730 (Polylang conflict):
/?s=testFor #2725 (Posts page redirect):
Changelog entry
Changelog Entry Details
Significance
Type
Message
Fixed unwanted 301 redirects on search and posts pages when using Polylang or similar plugins.