Make WordPress Core

Opened 8 days ago

#62135 new defect (bug)

Custom Post Type feed rewrites not generated when has_archive is false

Reported by: sippis's profile sippis Owned by:
Milestone: Awaiting Review Priority: normal
Severity: minor Version:
Component: Posts, Post Types Keywords:
Focuses: Cc:

Description

I have a Custom Post Type called movies. In the registration, I've set has_archive to false but rewrite.feeds to true.

The [documentation of parameters](https://developer.wordpress.org/reference/functions/register_post_type/#parameters) leads me to believe that this would cause feed rewrites being generated in /movies/feed although I don't have archive at /movies.

feeds bool
Whether the feed permastruct should be built for this post type.
Default is value of $has_archive.

That is not what happens. The feed permastruct is not built unless has_archive is true. See https://github.com/WordPress/wordpress-develop/blob/trunk/src/wp-includes/class-wp-post-type.php#L712-L725

Change History (0)

Note: See TracTickets for help on using tickets.