Opened 14 years ago
Last modified 6 years ago
#16415 new enhancement
Don't require CPTs to have archives in order to have feeds
Reported by: | aaroncampbell | Owned by: | |
---|---|---|---|
Milestone: | Priority: | normal | |
Severity: | normal | Version: | 3.1 |
Component: | Posts, Post Types | Keywords: | has-patch |
Focuses: | Cc: |
Description
When archives and feeds were added to custom post types (see #13818) it was set up so you had to have archives (has_archive) in order to have feeds (rewrite[feeds]).
There are some situations where it would be nice to have feeds but archives aren't needed.
Attachments (7)
Change History (28)
#2
follow-up:
↓ 3
@
14 years ago
You would still need to use the has_archive
though Aaron (even with your patch), unless I'm hugely mistaken? Take site.com/cpt-archive/feed/ for example, which gives you what it does currently, where would the /feed/ be if there was no archives? Or have I still missed something?
Unless you're on about doing site.com/cpt-rewrite-slug/feed/ if I follow?
#3
in reply to:
↑ 2
;
follow-up:
↓ 5
@
14 years ago
@scribu:
Sorry, I explained it all to Nacin but didn't get it into the ticket because it seemed long winded. The quick example is my beer review site. It has two CPTs...beer and beer-review. I'd like to have a feed for beer-review. Something that other sites could consume and show the kind of activity on my site. However, having an archive page of reviews for all different beer reviews really doesn't make any sense because they're just too random (however, I do have an archive page for beers).
The quick solution for me is to turn on archives for both and redirect the beer-review archives to the beer archives, but the correct solution is to allow feeds without archives.
The other oddity is the slugs. If the feed is at /beer-review/feed/
and you remove feed/
you'll get a 404 if there's no archive. However, if there's no archive the same is true of each review which would look like /beer-review/my-beer-review-slug/
@markmcwilliams: I tested it on trunk at the #wcphx dev day and it worked without has_archive
. If you don't specify a has_archive
slug it uses the rewrite slug.
#4
@
14 years ago
- Keywords 2nd-opinion removed
Keep in mind we originally just supported /slug/post-slug/, not /slug/. Allowing /slug/feed/ even when not supporting /slug/ makes more sense in that context.
I spoke with aaron and agreed this would be a nice enhancement. Better to be as flexible as people want when it's easy to introduce it.
#5
in reply to:
↑ 3
@
14 years ago
Replying to aaroncampbell:
@markmcwilliams: I tested it on trunk at the #wcphx dev day and it worked without
has_archive
. If you don't specify ahas_archive
slug it uses the rewrite slug.
So I really ended up answering my own question! ;) And from that point of view (while I don't have a use for just the feed yet) it would be handy, like Nacin says.
#8
in reply to:
↑ 7
@
12 years ago
Replying to SergeyBiryukov:
Refreshed the patch (16415.diff didn't apply cleanly).
Thanks Sergey, it was on my TODO list but I hadn't got there yet. Looks good.
#10
@
12 years ago
16415.3.diff fixes get_post_type_archive_feed_link()
for post types with feeds and no archive.
#11
@
12 years ago
16415.4.diff only adds/removes the filter if it isn't already there.
#12
@
12 years ago
16415.5.diff switches the filter to ignore_has_archive_$post_type
which is better worded and allows you to pass a more logical __return_true
to override.
#13
follow-up:
↓ 20
@
12 years ago
- Keywords 3.6-early added
- Milestone changed from 3.5 to Future Release
I have some ideas here. Punting as this can be done by manually adding rules for now.
#17
@
12 years ago
I see that we punted this one again, which is fine, but I'm wondering what nacin's ideas were regarding this. I'd like to see this addressed in the near future, so if there's something I can do to help that happen let me know.
#18
@
11 years ago
- Milestone changed from Future Release to 3.7
Patch was failing against trunk, refreshed
#20
in reply to:
↑ 13
@
11 years ago
- Keywords commit 3.6-early removed
- Milestone changed from 3.7 to Future Release
Replying to nacin:
I have some ideas here. Punting as this can be done by manually adding rules for now.
Punting this to future release as there seems to be some outstanding thoughts on approach.
#21
@
9 years ago
16415.7.diff is a refresh
Could you give an example of such a situation?