Make WordPress Core

Changeset 60790

Timestamp:
09/22/2025 09:30:06 AM (3 weeks ago)
Author:
Bernhard Reiter
Message:

Block Bindings: Add block_bindings_supported_attributes filter.

Add a block-agnostic version of the block_bindings_supported_attributes_{$block_type} filter first introduced in [60611].

This allows adding block bindings support for attributes of multiple different blocks in one go.

Follow-up to [60611].
Props bernhard-reiter.
See #62090.

File:
1 edited

Legend:

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

    r60764 r60790  
    301301            self::BLOCK_BINDINGS_SUPPORTED_ATTRIBUTES[ $block_type ] ??
    302302            array();
     303
     304        /**
     305         * Filters the supported block attributes for block bindings.
     306         *
     307         * @since 6.9.0
     308         *
     309         * @param string[] $supported_block_attributes The block's attributes that are supported by block bindings.
     310         * @param string   $block_type                 The block type whose attributes are being filtered.
     311         */
     312        $supported_block_attributes = apply_filters(
     313            'block_bindings_supported_attributes',
     314            $supported_block_attributes,
     315            $block_type
     316        );
    303317
    304318        /**
Note: See TracChangeset for help on using the changeset viewer.