WordPress.org

Make WordPress Core

Opened 15 months ago

Closed 9 months ago

Last modified 8 months ago

#23302 closed defect (bug) (fixed)

Feeds or Feed - add_permastruct missunderstanding.

Reported by: butuzov Owned by: nacin
Milestone: 3.7 Priority: normal
Severity: normal Version: 3.5.1
Component: Posts, Post Types Keywords: has-patch
Focuses: Cc:

Description

In case of register_post_type you "can" specify to add feeds to permalink structure or not. You actualy can do that by specifing a 'feeds' element to false in rewrite array.

But add_permastruct doesn't accept feeds element of rewrite argument. Its accept 'feed' element which default is true. So in this case its not posible to disable feeds for any post type via register_post_type API.

Attachments (4)

feeds2feed.patch (640 bytes) - added by butuzov 15 months ago.
patch
feeds.php (1.2 KB) - added by butuzov 15 months ago.
Test case
23302.test.patch (739 bytes) - added by johnpbloch 9 months ago.
Unit test
23302.patch (645 bytes) - added by johnpbloch 9 months ago.

Download all attachments as: .zip

Change History (10)

butuzov15 months ago

patch

butuzov15 months ago

Test case

comment:1 SergeyBiryukov15 months ago

  • Component changed from Permalinks to Post Types

johnpbloch9 months ago

Unit test

johnpbloch9 months ago

comment:2 johnpbloch9 months ago

I updated the original fix to use array merge so that 'feed' doesn't get added to the post type's rewrite array. I also added a patch for the unit test.

comment:3 nacin9 months ago

In 1324/tests:

Test for passing the correct argument to add_permastruct() when registering a post type.

props johnpbloch.
see #23302.

comment:4 nacin9 months ago

  • Owner set to nacin
  • Resolution set to fixed
  • Status changed from new to closed

In 24830:

When registering a post type, pass the correct argument for feeds to add_permastruct().

props butuzov, johnpbloch.
fixes #23302.

comment:5 marcosf9 months ago

I've added a patch to remove 1 condition in posts.php that made has_archive overwrite the feed setting in #24867 . I had a brief discussion about this with Nacin today.

comment:6 ocean908 months ago

  • Milestone changed from Awaiting Review to 3.7
Note: See TracTickets for help on using tickets.