[wp-trac] [WordPress Trac] #18752: Allow category preference in permalinks
WordPress Trac
wp-trac at lists.automattic.com
Fri Sep 23 00:27:34 UTC 2011
#18752: Allow category preference in permalinks
---------------------------+------------------------------
Reporter: aaroncampbell | Owner:
Type: defect (bug) | Status: new
Priority: normal | Milestone: Awaiting Review
Component: General | Version: 3.2
Severity: normal | Resolution:
Keywords: has-patch |
---------------------------+------------------------------
Comment (by aaroncampbell):
It has the potential to change exiting permalinks but only if someone
specifically writes code (like in my comment above) to do that. If they
*do* then as nacin said, the new permalink will match the canonical URL.
However, URLs changed in this way will NOT get redirected with
`redirect_canonical()` because when it deals with `%category%` it checks
if the cat in the current URL is valid for the post and if it is it
doesn't try to redirect. Since the previous category would be valid (even
if not preferred) it would not redirect. However, this is consistent with
what happens currently (if a post is in 3 categories it has three URLs
that will work and not redirect, but only one that is canonical), and you
could force a redirect with your own function hooking into
`template_redirect` for these situations.
Having had the chance to test it a lot more today...it's working really
well for my use cases.
--
Ticket URL: <http://core.trac.wordpress.org/ticket/18752#comment:9>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software
More information about the wp-trac
mailing list