Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Save button label should be filterable to better enable custom workflows with custom statuses #18743

Closed
davisshaver opened this issue Nov 26, 2019 · 2 comments
Labels
[Feature] Extensibility The ability to extend blocks or the editing experience [Type] Copy Issues or PRs that need copy editing assistance

Comments

@davisshaver
Copy link
Contributor

davisshaver commented Nov 26, 2019

Is your feature request related to a problem? Please describe.
Working with the Edit Flow project, we have run into an issue regarding how best to alter the "save" label to reflect the target status. Currently the text flips from "Save" to "Save Draft" after a user clicks save, regardless of status, which we find to be a confusing user experience.

Here is where the label is generated: https://github.com/WordPress/gutenberg/blob/master/packages/editor/src/components/post-saved-state/index.js#L104

See discussion here: Automattic/Edit-Flow#555 (comment)

Describe the solution you'd like
Allow the function that generates the label filterable. Here is the logic used for the "default" function.

const label = isPending ? __( 'Save as Pending' ) : __( 'Save Draft' );

If the function were filterable, plugins could provide a function that is passed or has access to the status and use their own mapping for what label should be returned.

Describe alternatives you've considered
Currently we are exploring MutationObservers and polling as ways to get an updated label text in the block editor. There are performance implications with these approaches and it would be ideal to identify a "block editor native" means of accomplishing this.

Links to related issues
We believe this issue is a new and self-contained feature request, but there are related issues open in the project already. See also:

@gziolo gziolo added [Feature] Extensibility The ability to extend blocks or the editing experience [Type] Copy Issues or PRs that need copy editing assistance labels Dec 9, 2019
@paaljoachim
Copy link
Contributor

Hey @davisshaver Davis

How is this issue coming along?

@gziolo
Copy link
Member

gziolo commented Jan 28, 2021

It should be now possible with the changes added in #27966.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Feature] Extensibility The ability to extend blocks or the editing experience [Type] Copy Issues or PRs that need copy editing assistance
Projects
None yet
Development

No branches or pull requests

3 participants