WordPress at a glance
function is not described

WP_Block_Supports::register_attributes() private WP 5.6.0

Registers the block attributes required by the different block supports.

{} It's a method of the class: WP_Block_Supports{}

No Hooks.

Return

null. Nothing.

Usage

// private - for code of main (parent) class only
$result = $this->register_attributes();

Changelog

Since 5.6.0 Introduced.

Code of WP_Block_Supports::register_attributes() WP 5.7.2

<?php
private function register_attributes() {
	$block_registry         = WP_Block_Type_Registry::get_instance();
	$registered_block_types = $block_registry->get_all_registered();
	foreach ( $registered_block_types as $block_type ) {
		if ( ! property_exists( $block_type, 'supports' ) ) {
			continue;
		}
		if ( ! $block_type->attributes ) {
			$block_type->attributes = array();
		}

		foreach ( $this->block_supports as $block_support_config ) {
			if ( ! isset( $block_support_config['register_attribute'] ) ) {
				continue;
			}

			call_user_func(
				$block_support_config['register_attribute'],
				$block_type
			);
		}
	}
}