WP_Theme_JSON::do_opt_in_into_settings()protected staticWP 5.9.0

Enables some settings.

Method of the class: WP_Theme_JSON{}

No Hooks.

Return

null. Nothing (null).

Usage

$result = WP_Theme_JSON::do_opt_in_into_settings( $context );
$context(array) (required) (passed by reference — &)
The context to which the settings belong.

Changelog

Since 5.9.0 Introduced.

WP_Theme_JSON::do_opt_in_into_settings() code WP 6.5.2

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'] );
}