WP_Theme_JSON::get_merged_preset_by_slug( array $preset_per_origin, string $value_key ): array

In this article

This function’s access is marked private. This means it is not intended for use by plugin or theme developers, only in other core functions. It is listed here for completeness.

Given an array of presets keyed by origin and the value key of the preset, it returns an array where each key is the preset slug and each value the preset value.

Parameters

$preset_per_originarrayrequired
Array of presets keyed by origin.
$value_keystringrequired
The property of the preset that contains its value.

Return

array Array of presets where each key is a slug and each value is the preset value.

Source

 *
 * @since 5.9.0
 *
 * @param array $context The context to which the settings belong.
 */
protected static function do_opt_in_into_settings( &$context ) {
	foreach ( static::APPEARANCE_TOOLS_OPT_INS as $path ) {
		/*
		 * Use "unset prop" as a marker instead of "null" because
		 * "null" can be a valid value for some props (e.g. blockGap).
		 */
		if ( 'unset prop' === _wp_array_get( $context, $path, 'unset prop' ) ) {
			_wp_array_set( $context, $path, true );
		}
	}

	unset( $context['appearanceTools'] );
}

Changelog

VersionDescription
5.8.0Introduced.

User Contributed Notes

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