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

Add Block Factory #6

Open
2 tasks
XedinUnknown opened this issue May 10, 2021 · 0 comments
Open
2 tasks

Add Block Factory #6

XedinUnknown opened this issue May 10, 2021 · 0 comments
Labels
enhancement New feature or request

Comments

@XedinUnknown
Copy link
Member

XedinUnknown commented May 10, 2021

The Problem

There is a Gutenberg\BlockInterface, and a common way of creating one seems to be by using a map returned by parse_blocks(). Unfortunately, there's nothing right now that could allow the creation of a block from such a map. There's no way at all to abstract block initialization.

Suggested Solution

  • Add a BlockFactoryInterface that would accept the key parameters for blocks separately and with proper type declarations.
  • Add a ConfigBasedBlockFactoryInterface that would accept an array map of values from one of the items of parse_blocks(). This allows easy creation from configuration, based on WP config key conventions.
@XedinUnknown XedinUnknown added the enhancement New feature or request label May 10, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant