WP_Theme_JSON::get_setting_nodes( array $theme_json, array $selectors = array() ): array

Builds metadata for the setting nodes, which returns in the form of:


Description

[ [ ‘path’ => [‘path’, ‘to’, ‘some’, ‘node’ ], ‘selector’ => ‘CSS selector for some node’ ], [ ‘path’ => [ ‘path’, ‘to’, ‘other’, ‘node’ ], ‘selector’ => ‘CSS selector for other node’ ], ]


Top ↑

Parameters

$theme_json array Required
The tree to extract setting nodes from.
$selectors array Optional
List of selectors per block.

Default: array()


Top ↑

Return

array An array of setting nodes metadata.


Top ↑

Source

File: wp-includes/class-wp-theme-json.php. View all references

	}

	if ( is_array( $value ) ) {
		return $value;
	}

	return $value;
}

/**
 * Builds metadata for the setting nodes, which returns in the form of:
 *
 *     [
 *       [
 *         'path'     => ['path', 'to', 'some', 'node' ],
 *         'selector' => 'CSS selector for some node'
 *       ],
 *       [
 *         'path'     => [ 'path', 'to', 'other', 'node' ],
 *         'selector' => 'CSS selector for other node'
 *       ],
 *     ]
 *
 * @since 5.8.0
 *
 * @param array $theme_json The tree to extract setting nodes from.
 * @param array $selectors  List of selectors per block.
 * @return array An array of setting nodes metadata.
 */
protected static function get_setting_nodes( $theme_json, $selectors = array() ) {
	$nodes = array();

Top ↑

Changelog

Changelog
Version Description
5.8.0 Introduced.

Top ↑

User Contributed Notes

You must log in before being able to contribute a note or feedback.