Make WordPress Core


Ignore:
Timestamp:
09/14/2022 10:50:26 AM (2 years ago)
Author:
gziolo
Message:

Blocks: Allow registering multiple items for all supported asset types

Follow-up #54337, [52069]. Part of https://github.com/WordPress/gutenberg/issues/41236. More details in https://github.com/WordPress/gutenberg/issues/33542.

Allow passing more than one script per block for editorScript, script, and viewScript fields in the block.json metadata file. This aligns with the previously added changes for style and editorStyle fields.

This change impacts the WP_Block_Type class and the REST API endpoint for block types. To ensure backward compatibiliy old names were soft deprecated in favor of new fields that work with array values and have _handles suffix.

Props zieladam, dlh, timothyblynjacobs, aristath, bernhard-reiter.
Fixes #56408.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tests/phpunit/data/blocks/notice/block.json

    r54132 r54155  
    5858    "editorScript": "tests-notice-editor-script",
    5959    "script": "tests-notice-script",
    60     "viewScript": "tests-notice-view-script",
     60    "viewScript": [ "tests-notice-view-script", "tests-notice-view-script-2" ],
    6161    "editorStyle": "tests-notice-editor-style",
    62     "style": "tests-notice-style",
     62    "style": [ "tests-notice-style", "tests-notice-style-2" ],
    6363    "render": "file:./render.php"
    6464}
Note: See TracChangeset for help on using the changeset viewer.