Make WordPress Core


Ignore:
Timestamp:
09/29/2025 08:57:51 AM (2 months ago)
Author:
Bernhard Reiter
Message:

Block Bindings: Communicate supported block attributes from server.

Instead of requiring the client side to keep a separate list of block attributes that are supported by Block Bindings, communicate that list from the server -- including block attributes that were added there via the block_bindings_supported_attributes filter.

Props bernhard-reiter, mukesh27, gziolo.
Fixes #64030.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/block-editor.php

    r60648 r60807  
    496496        $custom_settings
    497497    );
     498
     499    $editor_settings['__experimentalBlockBindingsSupportedAttributes'] = array();
     500    foreach ( array_keys( WP_Block_Type_Registry::get_instance()->get_all_registered() ) as $block_type ) {
     501        $supported_block_attributes = get_block_bindings_supported_attributes( $block_type );
     502        if ( ! empty( $supported_block_attributes ) ) {
     503            $editor_settings['__experimentalBlockBindingsSupportedAttributes'][ $block_type ] = $supported_block_attributes;
     504        }
     505    }
    498506
    499507    $global_styles = array();
Note: See TracChangeset for help on using the changeset viewer.