Make WordPress Core

Opened 11 years ago

Last modified 5 years ago

#23168 new enhancement

Introduce remove_post_status

Reported by: kovshenin's profile kovshenin Owned by:
Milestone: Priority: normal
Severity: normal Version:
Component: Posts, Post Types Keywords: needs-patch
Focuses: Cc:

Description

Plugins and themes should be able to remove the default post statuses defined by core.

Change History (19)

#1 @kovshenin
11 years ago

  • Type changed from defect (bug) to enhancement

#2 follow-up: @sirzooro
11 years ago

IMHO this should go to #12706.

#3 in reply to: ↑ 2 ; follow-up: @kovshenin
11 years ago

Replying to sirzooro: Yeah, just trying to break that ticket down into smaller pieces, that's all ;)

#4 @sabreuse
11 years ago

  • Cc sabreuse added

#5 in reply to: ↑ 3 @sirzooro
11 years ago

  • Cc sirzooro added

Replying to kovshenin:

Replying to sirzooro: Yeah, just trying to break that ticket down into smaller pieces, that's all ;)

OK, I see :)

#6 @danielbachhuber
11 years ago

There are probably some core statuses (e.g. 'Trash') we'll need to protect from removal to avoid breaking all the things.

#7 @SergeyBiryukov
11 years ago

Perhaps unregister_post_status() would be a better name, for consistency with unregister_taxonomy() (suggested in #11058).

#8 @nacin
11 years ago

Removing core post statuses, for core post types, is likely going to be very prone to breakage, which is why we have yet to introduce an unregistration for taxonomies or post types.

A better way to approach this is to segment post statuses against individual post types. Really, you probably shouldn't be able to remove a post status at all, only remove it for individual post types. Should post statuses even be shared against a post type? That can cause problems when you might want certain behavior for "active" on one type but different behavior for another type. Worse when two plugins both want an "active" status for their own post types — as they should be allowed to do.

#9 @kovshenin
11 years ago

I also think you shouldn't be able to completely remove post statuses, types and taxonomies, but rather unregister them from object types, which I think would cover most of the use cases. So perhaps we should add unregister_post_status_for_object_type instead.

unregister_taxonomy_for_object_type was also discussed in #11058.

#10 @greenshady
11 years ago

  • Cc justin@… added

#12 @adamsilverstein
11 years ago

  • Cc ADAMSILVERSTEIN@… added

#13 @sc0ttkclark
11 years ago

  • Cc lol@… added

#14 @aniketpant
11 years ago

  • Cc me@… added

#15 @m_uysl
11 years ago

  • Cc m_uysl@… added

#16 @mordauk
11 years ago

  • Cc pippin@… added

I'll throw my two cents in and agree with @kovshenin and @nacin that statuses should be removed on a per-object basis.

#17 @SergeyBiryukov
11 years ago

  • Milestone changed from 3.6 to Future Release

#18 @nacin
10 years ago

  • Component changed from General to Post Types

#19 @chriscct7
8 years ago

  • Keywords editorial-flow removed
Note: See TracTickets for help on using tickets.