Returns the default slugs for all the presets in an associative array whose keys are the preset paths and the leafs is the list of slugs.
For example:
array(
'color' => array(
'palette' => array( 'slug-1', 'slug-2' ),
'gradients' => array( 'slug-3', 'slug-4' ),
),
)$dataarrayrequired
$node_patharrayrequired
'settings' by default. $nodes[] = array(
'path' => $node_path,
);
continue;
}
$nodes[] = array(
'path' => $node_path,
'selector' => $selectors[ $name ]['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']['blocks'][ $name ]['elements'][ $element ][ $pseudo_selector ] ) ) {
$node_path = array( 'styles', 'blocks', $name, 'elements', $element );
if ( $include_node_paths_only ) {
$nodes[] = array(
'path' => $node_path,
);
continue;
}
$nodes[] = array(
'path' => $node_path,
'selector' => static::append_to_selector( $selectors[ $name ]['elements'][ $element ], $pseudo_selector ),
);
| Version | Description |
|---|---|
| 5.9.0 | Introduced. |
© 2003–2024 WordPress Foundation
Licensed under the GNU GPLv2+ License.
https://developer.wordpress.org/reference/classes/wp_theme_json/get_default_slugs