#15140 closed enhancement (fixed)
When non-hierarchical CPT permalinks change, we should 301 redirect like with posts
Reported by: | jorbin | Owned by: | markjaquith |
---|---|---|---|
Milestone: | 3.1 | Priority: | normal |
Severity: | normal | Version: | |
Component: | Canonical | Keywords: | |
Focuses: | Cc: |
Description
Change History (21)
#3
@
14 years ago
- Milestone changed from Awaiting Review to 3.1
- Owner set to nacin
- Status changed from new to accepted
I've been meaning to create this ticket for about two weeks.
#4
@
14 years ago
- Milestone 3.1 deleted
- Resolution set to duplicate
- Status changed from accepted to closed
#5
follow-up:
↓ 6
@
14 years ago
- Milestone set to 3.1
- Resolution duplicate deleted
- Status changed from closed to reopened
The scope for this ticket is much narrower.
I will post a patch.
#6
in reply to:
↑ 5
@
14 years ago
Replying to nacin:
The scope for this ticket is much narrower.
I beg to differ. If you implement it for the previous URL without bugs (I.e. deleting conflicts as they appear), implementing it for all URLs is a matter of using multiple key/values instead of a single one.
#7
@
14 years ago
I've been trying to find the code that does that, but I guess I haven't been trying hard enough.
Probably be looking for wp_old_slug_redirect() ..That really should be merged with Canonical IMO..
#10
@
14 years ago
I realised this morning, That I didn't limit the redirection to posts of the same post type as being requested..
Potential thoughts of mine:
- Request ALL matching records, foreach ($post ) { if ( compare post type ) { redirect;break; } }
- JOIN in SQL, seems overkill.
#12
@
14 years ago
- Resolution set to fixed
- Status changed from reopened to closed
Closing as fixed, Re-open if a bug related to this crops up in 3.1 testing, Else, open a new ticket.
#13
@
14 years ago
- Resolution fixed deleted
- Status changed from closed to reopened
Let's implement #9825 step/bug by step/bug...
If both the slug and the parent change, the redirect doesn't work.
#14
@
14 years ago
Oh, forgot to mention. You then need to create a new page, different parent, same slug, to fully appreciate why we need to store/flush the actual permalink, rather than just the slug.
#16
@
14 years ago
- Owner changed from nacin to markjaquith
- Status changed from reopened to reviewing
Denis' objection is noted. I don't think this is ready for hierarchical post types. I'm working on a patch to restrict this to non-hierarchical post types for now, and we can look at a hierarchical fix for 3.2
#20
@
14 years ago
- Milestone changed from Future Release to 3.1
- Resolution set to fixed
- Status changed from reviewing to closed
- Summary changed from When page permalinks change, we should 301 redirect like with posts to When non-hierarchical CPT permalinks change, we should 301 redirect like with posts
Closing as fixed in 3.1 for non-hierarchical post types, For Pages, We have #4328 still
#21
@
13 years ago
http://core.trac.wordpress.org/changeset/16818/trunk/wp-includes/query.php broke a trick I've leveraged where I stuffed _wp_old_slug into the DB for a page, and then the redirect took place. Very few have likely done that, but it's technically a regression.
I've been trying to find the code that does that, but I guess I haven't been trying hard enough.
+1 from me.