Opened 12 years ago
Last modified 6 years ago
#23168 new enhancement
Introduce remove_post_status
Reported by: | 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)
#3
in reply to:
↑ 2
;
follow-up:
↓ 5
@
12 years ago
Replying to sirzooro: Yeah, just trying to break that ticket down into smaller pieces, that's all ;)
#6
@
12 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
@
12 years ago
Perhaps unregister_post_status()
would be a better name, for consistency with unregister_taxonomy()
(suggested in #11058).
#8
@
12 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
@
12 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.
IMHO this should go to #12706.