WordPress.org

Make WordPress Core

Opened 3 years ago

Closed 3 years ago

Last modified 2 years ago

#21944 closed enhancement (maybelater)

Allow changing the parameters for built-in post types

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

Description (last modified by scribu)

Currently, it's really hard to change a single aspect of the built-in post types.

As shown in 3:ticket:21943, users are reverting to all sorts of ugly workarounds.

What's needed is a filter for the args array, before any processing is done inside register_post_type().

Attachments (1)

21944.diff (420 bytes) - added by scribu 3 years ago.

Download all attachments as: .zip

Change History (7)

comment:1 @scribu3 years ago

  • Description modified (diff)

@scribu3 years ago

comment:2 @scribu3 years ago

  • Keywords has-patch added

21944.diff applies the 'post_type_args' filter right after the defaults are set.

comment:4 @scribu3 years ago

  • Milestone Awaiting Review deleted
  • Resolution set to maybelater
  • Status changed from new to closed

To summarize, nacin pointed out that with the filter, devs could also mess with capabilities, menus etc. which would break things.

And allowing the filter for non-core post types is very niche, since plugins can just define their own filter, before calling register_post_type().

SergeyBiryukov: Related: #19590

comment:6 @MikeSchinkel2 years ago

This is a duplicate of #17447.

Note: See TracTickets for help on using tickets.