Save button label should be filterable to better enable custom workflows with custom statuses #18743
Labels
[Feature] Extensibility
The ability to extend blocks or the editing experience
[Type] Copy
Issues or PRs that need copy editing assistance
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.
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:
The text was updated successfully, but these errors were encountered: