#53148 closed feature request (fixed)
Blocks: Add new `render` property in `block.json` for block types
Reported by: | gziolo | Owned by: | gziolo |
---|---|---|---|
Milestone: | 6.1 | Priority: | normal |
Severity: | normal | Version: | |
Component: | Editor | Keywords: | has-patch has-unit-tests needs-dev-note |
Focuses: | Cc: |
Description
See comment from @spacedmonkey on GitHub (https://github.com/WordPress/gutenberg/pull/13693#discussion_r287337504):
Current the render callback is a function call. How would it work as a file? Why not make it
renderTemplate
but still allow forrenderCallback
. Function calls, should be a method in a class or be namespaced, which wouldn't really work in another file.
ACF blocks, has a rendercallback / render template in it's block definitions.
There is also another thread started by @spacedmonkey in https://github.com/WordPress/gutenberg/pull/13693#discussion_r288121797 which expands on this topic.
Change History (9)
#3
@
2 years ago
- Keywords has-patch has-unit-tests added
- Milestone changed from Awaiting Review to 6.1
- Summary changed from Editor: Consider adding `renderTemplate` property for block types to Blocks: Add new `render` property in `block.json` for block types
This ticket was mentioned in PR #3222 on WordPress/wordpress-develop by gziolo.
2 years ago
#4
Trac ticket: https://core.trac.wordpress.org/ticket/53148
2 years ago
#6
Committed with https://core.trac.wordpress.org/changeset/54132.
#7
@
2 years ago
FWIW, I think core generally does not include DocBlocks for anonymous functions like the one added in [54132], but I don't see any issues with that at a glance. I guess it won't be displayed in the WordPress Developer Reference, just hope it does not break the parser :)
I created a prototype in the Gutenberg plugin: https://github.com/WordPress/gutenberg/pull/42430.