Open hlashbrooke opened 6 years ago
Related: https://core.trac.wordpress.org/ticket/12706 "Custom post status bugs"
Related #2457.
Just so it's explicitly stated: WordPress doesn't have a formal API for custom post statuses, so that may hinder the eventual implementation.
This came up in editorial testing. Using PublishPress.
Also related https://github.com/WP-API/WP-API/issues/1820
I've documented this issue in the migration guide.
Moving this to WP 5.1 Onwards
. We'll need to decide upon the formal API for custom post statuses before Gutenberg can support this.
Would also love to see this implemented; lack of custom statuses in Gutenberg is a dealbreaker for our organization and many other organizations, I imagine.
We are working towards using custom statuses to label and organized content so it can then be improved and edited by multiple parties (the original writers, copy editors, someone else to review it for accessibility, correct any image formatting, SEO, etc) before it is finally published publicly.
I'm interested to hear how other sites who are using pressbooks, publishpress, Editflow, and Oasis-Workflow, are dealing with this.
(Written as a CPL employee) (2022 Update: we ended up having to go around this by the Revisions plugin in WordPress)
@skorasaurus 👋 I'm from @pressbooks. We talked about this a bit in the core REST API chat last week. I'm going to do a bit of digging into the history around custom statuses and propose a path for formal support in core, which my help move this issue forward.
Curious has anyone made any progress on this in the last 6 months?
The Edit Flow plugin updated with Gutenberg support, according to https://wordpress.org/plugins/edit-flow/#developers, so I'm assuming that something was done. @rinatkhaziev would know more.
Their implementation is here: https://github.com/Automattic/Edit-Flow/blob/master/blocks/src/custom-status/block.js
I left my previous job at the end of February and so I haven't followed up on this as it's not a priority for my new job. Sorry for dropping the ball.
Thanks everyone for responding. Glad to see it's not dead yet. 😺
Hi @mikelking @greatislander @benlk. Yeah, it was released 6 months ago as a part of Edit Flow 0.9. It a tad hacky, mostly due to the core's limited implementation of custom post statuses.
That said, PRs are welcome :)
Hi, FYI: to complement the above PR/wait for this issue to be solved, I’ve updated the WP Statuses so that you can already use custom statuses into the Block Editor.
Really looking forward seing this functionality implemented... Any news on a potential release date? @imath great solution btw, thanks for the temporary fix. It's a shame it gets broken if you use a fixed template for the CPT...
thanks for your feedback @leorospo could you be more specific about or:
It's a shame it gets broken if you use a fixed template for the CPT...
Maybe it's best to carry on in the WP Statuses repository, don't hesitate to open a new issue.
Thanks @imath for your fast reply. I just opened an issue to better explain the problem(https://github.com/imath/wp-statuses/issues/36). Let's carry on there then.
@hlashbrooke @imath @leorospo or anyone else. Can we get a status update for this issue? Thanks!
This is still waiting on custom post statuses in core, https://core.trac.wordpress.org/ticket/12706, and then support in the REST API.
I suggest that we close this issue until there is an opening in core. We can at that time reopen this issue. Does that sound ok?
What about adding the [Status] Blocked
label instead, since it's still a problem that users are experiencing?
it is surprising after 5 years of the release this support for something that is in wordpress since more years is not available in gutenberg and block the plugin development to invent other solutions...
it is surprising after 5 years of the release this support for something that is in wordpress since more years is not available in gutenberg and block the plugin development to invent other solutions...
It is disappointing and makes for some difficulties running a large publishing site on WordPress. We keep running into issues with floating publish dates not being respected (even know its an option on the register function https://developer.wordpress.org/reference/functions/register_post_status/) so posts end up being published in the past as the Publish Date gets set when a post is moved to a custom status.
Is there an established system to crowdfund a block editor PR like this yet?
@lkraav Just learned of this one https://wptavern.com/the-wp-community-collective-launches-nonprofit-to-fund-individual-contributors-and-community-based-initiatives
Just doing the code patch is not enough if no one review the code and approve it. In WordPress usually that one is the problem with code contribution.
Just doing the code patch is not enough if no one review the code and approve it. In WordPress usually that one is the problem with code contribution.
For sure, but review+ phase is usually the smaller part of the problem, for anything other than one/two-liner fixes.
Does the REST API have a mechanism for listing the available statuses? EditFlow registers its own list at window.EditFlowCustomStatuses
to work around this.
Without exposing that information via the API there's no way for the block editor to know about custom statuses and present them as an option to the user, or to understand what their impact on the block editors UI should be. This also delves a little into the long open question about how custom statuses should work in WordPress on the PHP side.
Once that problem has been solved, then proper block editor support would be possible.
To reiterate, open problems:
Hey @tomjn, thanks for commenting.
The REST API has support for retreiving statuses: https://developer.wordpress.org/rest-api/reference/post-statuses/
The controller uses get_post_stati()
to get status, which should include anything registered with register_post_status()
(I haven't tested that).
The REST API also has support for retrieving post types: https://developer.wordpress.org/rest-api/reference/post-types/ but does not include statuses that a post type supports. That could be added when the item is prepared for response using get_available_post_statuses().
I'm happy to add status support to post type response if someone else can tackle the thornier block editor side of things. Edit: I see @imath already has a PR that implements some of this.
@ntsekouras I am wondering if this issue can be closed with #63293 merged? And if it should stay open, what would the next steps be? Or is it part of a larger tracking issue?
@ntsekouras I am wondering if this issue can be closed with https://github.com/WordPress/gutenberg/pull/63293 merged? And if it should stay open, what would the next steps be? Or is it part of a larger tracking issue?
It should stay open and see how to retrieve custom status through REST API (based on the above comment) and update the UI and logic we have for statuses to handle them properly.
Issue Overview
On a site with custom post statuses (on a CPT in this case), the custom statuses are not available anywhere in the Gutenberg UI, so they are are effectively unusable without switching to the classic editor.
Steps to Reproduce
Using:
Expected Behaviour
The custom statuses should be available in Gutenberg.
Current Behavior
No custom statuses in Gutenberg.