imath / wp-statuses

WordPress plugin to ease Custom Post Statuses integration
GNU General Public License v2.0
161 stars 27 forks source link

Consider revising wp_statuses_unregister_status_for_post_type #78

Open shawfactor opened 1 year ago

shawfactor commented 1 year ago

Currently if the publish post status is unregistered this function also unregisters draft and pending

I think this logic should be reviewed. There are many use cases where publish may not be desired but draft are pending are

eg I created a “sent” status for a letter custom post type. I did not want unauthenticates users to access the cpt so I unregistered publish. But I did want the workflow associated with draft and pending statuses. I forked the code to get it to work but that is not ideal.

I suggest removing the current logic and if people don’t want draft and pending they can explicitly unregister them. Is that possible?

if that is not possible due to backwards compatibility then can you please add a filter so this logic can be bypassed?

imath commented 1 year ago

I see. I can't remember why I made this choice in the first place, but I'll look at it for sure. Thanks for your feedback.