Open
Description
openedon May 4, 2018
Previously: https://github.com/WordPress/gutenberg/pull/3686/files#r185262287
Currently, a block implementer may need to anticipate that any of the following functions may be undefined
if the post template is locked for editing:
insertBlocksAfter
onReplace
mergeBlocks
Instead of placing the burden on the developer to differentiate between the type, we should simply pass it as a function regardless of whether the template is locked. If it is a locked template, the function should effectively be a noop.
Open questions:
- Are there valid use cases where a block implementer may legitimately want to distinguish characteristics of the block depending on whether the template is locked or not? This information is still available via
withSelect
, and could additionally be passed as a prop to the block'sedit
component.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Metadata
Assignees
Labels
Ideas about improving block and theme developer experienceIdeas about improving block and theme developer experienceAPI that allows to express the block paradigm.API that allows to express the block paradigm.Used to indicate that the issue at hand isn't a top priority to address and can be handled laterUsed to indicate that the issue at hand isn't a top priority to address and can be handled laterIssues or PRs that have been broken down into an individual action to takeIssues or PRs that have been broken down into an individual action to take