[ Index ]

PHP Cross Reference of WordPress Trunk (Updated Daily)

Search

title

Body

[close]

/wp-includes/block-supports/ -> auto-register.php (summary)

Auto-register block support.

File Size: 61 lines (2 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 0 files

Defines 1 function

  wp_mark_auto_generate_control_attributes()

Functions
Functions that are not part of a class:

wp_mark_auto_generate_control_attributes( array $args )   X-Ref
Marks user-defined attributes for auto-generated inspector controls.

This filter runs during block type registration, before the WP_Block_Type
is instantiated. Block supports add their attributes AFTER the block type
is created (via {@see WP_Block_Supports::register_attributes()}), so any attributes
present at this stage are user-defined.

The marker tells generateFieldsFromAttributes() which attributes should
get auto-generated inspector controls. Attributes are excluded if they:
- Have a 'source' (HTML-derived, edited inline not via inspector)
- Have role 'local' (internal state, not user-configurable)
- Have an unsupported type (only 'string', 'number', 'integer', 'boolean' are supported)
- Were added by block supports (added after this filter runs)

param: array<string, mixed> $args Array of arguments for registering a block type.
return: array<string, mixed> Modified block type arguments.



Generated : Sun Jun 14 08:20:09 2026 Cross-referenced by PHPXref