Make WordPress Core

Opened 12 years ago

Closed 12 years ago

Last modified 12 years ago

#23302 closed defect (bug) (fixed)

Feeds or Feed - add_permastruct missunderstanding.

Reported by: butuzov's profile butuzov Owned by: nacin's profile 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 12 years ago.
patch
feeds.php (1.2 KB) - added by butuzov 12 years ago.
Test case
23302.test.patch (739 bytes) - added by johnpbloch 12 years ago.
Unit test
23302.patch (645 bytes) - added by johnpbloch 12 years ago.

Download all attachments as: .zip

Change History (10)

@butuzov
12 years ago

patch

@butuzov
12 years ago

Test case

#1 @SergeyBiryukov
12 years ago

  • Component changed from Permalinks to Post Types

@johnpbloch
12 years ago

Unit test

@johnpbloch
12 years ago

#2 @johnpbloch
12 years 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.

#3 @nacin
12 years ago

In 1324/tests:

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

props johnpbloch.
see #23302.

#4 @nacin
12 years 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.

#5 @marcosf
12 years 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.

#6 @ocean90
12 years ago

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