[wp-trac] [WordPress Trac] #47620: REST API: Expose blocks registered on the server
WordPress Trac
noreply at wordpress.org
Thu Nov 14 15:11:06 UTC 2019
#47620: REST API: Expose blocks registered on the server
-------------------------------------------------+-------------------------
Reporter: gziolo | Owner:
| spacedmonkey
Type: feature request | Status: assigned
Priority: normal | Milestone: Future
| Release
Component: REST API | Version: 5.0
Severity: normal | Resolution:
Keywords: has-patch has-unit-tests dev- | Focuses: rest-api
feedback |
-------------------------------------------------+-------------------------
Comment (by spacedmonkey):
In the [https://github.com/WordPress/gutenberg/blob/master/docs/rfc/block-
registration.md#editor-script RFC], editor_script, script, editor_style
and style are defines as URLs. However PHP registered block use script /
style handles. See [https://github.com/WordPress/WordPress/blob/master/wp-
includes/script-loader.php#L2864-L2891
wp_enqueue_registered_block_scripts_and_styles].
The `wp_enqueue_style` and `wp_enqueue_script` can not currently handle
passing a url to them.
TL:DR If you pass a URL in editor_script, script, editor_style and style
fields, is not going to work and may break things.
Also looking into this, I believe it is pointless to just output the url /
handle of the script. Without the dependencies, inline scripts,
translations and localized, the script is unless. So maybe we either need
to add all this data into the API or we need another REST API for this.
Thoughts @gziolo ?
--
Ticket URL: <https://core.trac.wordpress.org/ticket/47620#comment:15>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list