For metadata values that can either be booleans or paths to booleans, gets the value.
Description
$data = array( ‘color’ => array( ‘defaultPalette’ => true ) );
static::get_metadata_boolean( $data, false );
// => false
static::get_metadata_boolean( $data, array( 'color', 'defaultPalette' ) );
// => true
Parameters
$data
arrayrequired- The data to inspect.
$path
bool|arrayrequired- Boolean or path to a boolean.
$default_value
booloptional- Default value if the referenced path is missing.
Default:
false
Source
'selector' => static::ELEMENTS[ $element ],
);
// Handle any pseudo selectors for the element.
if ( isset( static::VALID_ELEMENT_PSEUDO_SELECTORS[ $element ] ) ) {
foreach ( static::VALID_ELEMENT_PSEUDO_SELECTORS[ $element ] as $pseudo_selector ) {
if ( isset( $theme_json['styles']['elements'][ $element ][ $pseudo_selector ] ) ) {
$nodes[] = array(
'path' => array( 'styles', 'elements', $element ),
'selector' => static::append_to_selector( static::ELEMENTS[ $element ], $pseudo_selector ),
);
}
}
Changelog
Version | Description |
---|---|
6.0.0 | Introduced. |
User Contributed Notes
You must log in before being able to contribute a note or feedback.