[5.6] Add the ability to define additional alternative save actions on elements#16294
Merged
brandonkelly merged 6 commits into5.6from Dec 10, 2024
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
On element edit pages it is currently possible to define additional buttons or action menu items that appear in the disclosure menu.
However, it isn't possible to define alternative save actions. This PR rectifies that issue by adding the ability for elements themselves to register their own alternative actions and also adds an event that developers can hook into.
From an element's perspective, this is good for a developer creating a custom element that they would like to have more than the standard set of alternative actions.
The event then gives developers the opportunity to hook into any element type to add additional alternative actions. Perhaps they could have additional actions for a specific entry type like "Save and send to XYZ API" or "Save and notify author".