wp-includes/class-wp-block-supports.php:20Class encapsulating and implementing Block Supports.
$block_supportsarrayprivate$block_to_renderarray|nullpublic static$instanceWP_Block_Supports|nullprivate static#[AllowDynamicProperties]class WP_Block_Supports { /** * Config. * * @since 5.6.0 * @var array * @phpstan-var array<string, array{ * name: string, * apply?: ApplyCallback, * register_attribute?: RegisterCallback, * }> */ private $block_supports = array(); /** * Tracks the current block to be rendered. * * @since 5.6.0 * @var array|null * @phpstan-var array<string, mixed>|null */ public static $block_to_render = null; /** * Container for the main instance of the class. * * @since 5.6.0 * @var WP_Block_Supports|null */ private static $instance = null; /** * Utility method to retrieve the main instance of the class. * * The instance will be created if it does not exist yet. * * @since 5.6.0 * * @return WP_Block_Supports The main instance. */ public static function get_instance() { if ( null === self::$instance ) { self::$instance = new self(); } return self::$instance; } /** * Initializes the block supports. It registers the block supports block attributes. * * @since 5.6.0 * * @return void */ public static function init() { $instance = self::get_instance(); $instance->register_attributes(); } /** * Registers a block support. * * @since 5.6.0 * * @link https://developer.wordpress.org/block-editor/reference-guides/block-api/block-supports/ * * @param string $block_support_name Block support name. * @param array $block_support_config Array containing the properties of the block support. * * @phpstan-param array{ * apply?: ApplyCallback, * register_attribute?: RegisterCallback, * } $block_support_config * * @return void */ public function register( $block_support_name, $block_support_config ) {Introduced in 5.6.0. Unchanged from 6.7.7 through 7.1.0.
Signature, return type and hooks compared across 5 parsed releases.
src/wp-includes/class-wp-block-supports.php, and regenerated for each WordPress release so it tracks the code rather than a snapshot of it.