Skip to content

Block Bindings: Expose bindable attributes through an annotation in the block definition #64756

Closed

Description

@zaguiini

What problem does this address?

As a plugin developer, there is currently no way of knowing whether or not a block attribute is bindable.

My current workaround is to hard code the list of known bindable attributes, but that might soon get outdated.

What is your proposed solution?

Add a new annotation to the block attribute definition explicitly stating that the attribute is bindable. Something like bindable: boolean.

Activity

  1. added
    [Feature] Block API
    on Aug 23, 2024
  2. gziolo commented on Sep 9, 2024

    @gziolo
    Member

    There is a slightly related prior exploration from @retrofox for exposing the list of allowed blocks and attributes from the source:

    @fabiankaegy described how we can build on top of the idea shared in this issue to open dynamic blocks for overrides/bindings:

  3. artemiomorales commented on Nov 4, 2024

    @artemiomorales
    Contributor

    If we use role: content to determine which attributes are bindable, would we still need a bindable: boolean flag?

    If we go with role: content as the bindings enabler, I imagine some developers would want the ability to opt content attributes out of block bindings. To address this, one option is to use the flag, though perhaps creating a list and accompanying filter for NOT_ALLOWED_BLOCKS could be a better approach.

  4. youknowriad commented on Oct 12, 2026

    @youknowriad
    Contributor

    Thanks for opening this! Since WordPress 6.9 there's an official way to find out which attributes are bindable: get_block_bindings_supported_attributes( $block_type ) in PHP, filterable via block_bindings_supported_attributes (#71663), and the same map is passed to the editor (#71820). So hard-coding the list is no longer necessary. Closing as addressed. If you specifically need a block.json annotation or a stable JS selector, please open a new issue describing that use case.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    [Feature] Block API[Feature] Block bindings[Type] Enhancement

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions