imath / wp-statuses

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

Workaround for posts using Gutenberg block editor #32

Closed rowatt closed 5 years ago

rowatt commented 5 years ago

Gutenberg does not support custom post statuses. The add_meta_box() method adds a metabox for custom post statuses, but this metabox conflicts with normal Gutenberg workflow. For example, if a new post is published, the post will stay in draft status unless the post status is changed to ‘publish’ in the added meta box before clicking ‘Publish’. Also, since Gutenberg doesn’t recognise custom post statuses, it assumes that any custom post status means the post is draft.

Any post types which always use Gutenberg should be excluded from using custom post statuses with the wp_statuses_get_supported_post_types filter. For cases where a post type has some posts using Gutenberg and some posts not, this commit ensures that the custom post status meta box is not added if the post uses Gutenberg.

Custom post statuses will not be available for those posts, but at least publishing the post will work as expected.

imath commented 5 years ago

Thanks a lot for your changes, let's have this in !

rowatt commented 5 years ago

Thanks for the fast turnaround... and for a very useful plugin!