W3cubDocs

/WordPress

WP_Theme_JSON::get_block_element_selectors( string $root_selector ): array

Generates all the element selectors for a block.

Parameters

$root_selectorstringrequired
The block’s root CSS selector.

Return

array The block’s element selectors.

Source

									$element_output[ $pseudo_selector ] = static::remove_insecure_styles( $element_input[ $pseudo_selector ] );
								}
							}
						}

						if ( ! empty( $element_output ) ) {
							_wp_array_set( $variation_output, array( 'elements', $element_name ), $element_output );
						}
					}
				}
			}

			if ( ! empty( $variation_output ) ) {
				_wp_array_set( $sanitized, $variation['path'], $variation_output );
			}
		}
	}
}

$setting_nodes = static::get_setting_nodes( $theme_json );
foreach ( $setting_nodes as $metadata ) {
	$input = _wp_array_get( $theme_json, $metadata['path'], array() );

Changelog

Version Description
6.3.0 Introduced.

© 2003–2024 WordPress Foundation
Licensed under the GNU GPLv2+ License.
https://developer.wordpress.org/reference/classes/wp_theme_json/get_block_element_selectors