wp-includes/block-supports/states.php:361Adds a compiled state style rule to a rule list.
$css_rulesarray$statestring$selectorstring|null$stylearray$rules_groupstring|nulloptionalnullfunction wp_add_block_state_style_rule( &$css_rules, $state, $selector, $style, $rules_group = null ) { if ( empty( $style ) || ! is_array( $style ) ) { return; } $compiled = wp_style_engine_get_styles( wp_normalize_state_style_for_css_output( $style ) ); $declarations = $compiled['declarations'] ?? array(); $text_align = $style['typography']['textAlign'] ?? null; // Base text alignment is class-based, so state styles need a declaration. if ( is_string( $text_align ) && '' !== trim( $text_align ) ) { $declarations['text-align'] = $text_align; } if ( empty( $declarations ) ) { return; } $css_rules[] = array( 'state' => $state, 'selector' => $selector, 'declarations' => $declarations, ); if ( ! empty( $rules_group ) ) { $css_rules[ count( $css_rules ) - 1 ]['rules_group'] = $rules_group; }}Introduced in 7.1.0.
Signature, return type and hooks compared across 1 parsed release.
src/wp-includes/block-supports/states.php, and regenerated for each WordPress release so it tracks the code rather than a snapshot of it.