WordPress / gutenberg

The Block Editor project for WordPress and beyond. Plugin is available from the official repository.
https://wordpress.org/gutenberg/
Other
10.35k stars 4.13k forks source link

Custom statuses are not supported #3144

Open hlashbrooke opened 6 years ago

hlashbrooke commented 6 years ago

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

  1. Create custom statuses for a CPT
  2. Notice their absence in Gutenberg
  3. :sob:

Using:

Expected Behaviour

The custom statuses should be available in Gutenberg.

Current Behavior

No custom statuses in Gutenberg.

ntwb commented 6 years ago

Related: https://core.trac.wordpress.org/ticket/12706 "Custom post status bugs"

gziolo commented 6 years ago

Related #2457.

danielbachhuber commented 6 years ago

Just so it's explicitly stated: WordPress doesn't have a formal API for custom post statuses, so that may hinder the eventual implementation.

davisshaver commented 6 years ago

This came up in editorial testing. Using PublishPress.

feedback

danielbachhuber commented 6 years ago

Also related https://github.com/WP-API/WP-API/issues/1820

danielbachhuber commented 6 years ago

I've documented this issue in the migration guide.

danielbachhuber commented 5 years ago

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.

skorasaurus commented 5 years ago

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)

greatislander commented 5 years ago

@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.

mikelking commented 5 years ago

Curious has anyone made any progress on this in the last 6 months?

benlk commented 5 years ago

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.

greatislander commented 5 years ago

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.

mikelking commented 5 years ago

Thanks everyone for responding. Glad to see it's not dead yet. 😺

rinatkhaziev commented 5 years ago

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 :)

imath commented 5 years ago

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.

leorospo commented 4 years ago

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...

imath commented 4 years ago

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.

leorospo commented 4 years ago

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.

paaljoachim commented 4 years ago

@hlashbrooke @imath @leorospo or anyone else. Can we get a status update for this issue? Thanks!

TimothyBJacobs commented 4 years ago

This is still waiting on custom post statuses in core, https://core.trac.wordpress.org/ticket/12706, and then support in the REST API.

paaljoachim commented 4 years ago

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?

iandunn commented 4 years ago

What about adding the [Status] Blocked label instead, since it's still a problem that users are experiencing?

Mte90 commented 2 years ago

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...

mgurtzweiler commented 1 year ago

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.

lkraav commented 1 year ago

Is there an established system to crowdfund a block editor PR like this yet?

mediaformat commented 1 year ago

@lkraav Just learned of this one https://wptavern.com/the-wp-community-collective-launches-nonprofit-to-fund-individual-contributors-and-community-based-initiatives

Mte90 commented 1 year ago

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.

lkraav commented 1 year ago

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.

tomjn commented 1 year ago

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:

mattradford commented 1 year ago

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.

bph commented 2 months ago

@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 commented 2 months ago

@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.