Make WordPress Core


Ignore:
Timestamp:
09/14/2022 10:50:26 AM (19 months 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/src/wp-includes/deprecated.php

    r53874 r54155  
    44434443    return false;
    44444444}
     4445
     4446/**
     4447  * Allows multiple block styles.
     4448  *
     4449  * @since 5.9.0
     4450  * @deprecated 6.1.0
     4451  *
     4452  * @param array $metadata Metadata for registering a block type.
     4453  * @return array Metadata for registering a block type.
     4454  */
     4455  function _wp_multiple_block_styles( $metadata ) {
     4456    _deprecated_function( __FUNCTION__, '6.1.0' );
     4457    return $metadata;
     4458}
Note: See TracChangeset for help on using the changeset viewer.