[wp-trac] [WordPress Trac] #62135: Custom Post Type feed rewrites not generated when has_archive is false

WordPress Trac noreply at wordpress.org
Mon Sep 30 11:56:58 UTC 2024


#62135: Custom Post Type feed rewrites not generated when has_archive is false
-------------------------------+-----------------------------
 Reporter:  sippis             |      Owner:  (none)
     Type:  defect (bug)       |     Status:  new
 Priority:  normal             |  Milestone:  Awaiting Review
Component:  Posts, Post Types  |    Version:
 Severity:  minor              |   Keywords:
  Focuses:                     |
-------------------------------+-----------------------------
 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

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/62135>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list