WP_Theme_JSON::do_opt_in_into_settings() WordPress Method

The do_opt_in_into_settings() method is used to add an opt-in checkbox to the WordPress settings page. This allows users to opt-in to receive updates and notifications about the theme.

WP_Theme_JSON::do_opt_in_into_settings( array $context ) #

Enables some settings.


Parameters

$context

(array)(Required)The context to which the settings belong.


Top ↑

Source

File: wp-includes/class-wp-theme-json.php

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


Top ↑

Changelog

Changelog
VersionDescription
5.9.0Introduced.

The content displayed on this page has been created in part by processing WordPress source code files which are made available under the GPLv2 (or a later version) license by theĀ Free Software Foundation. In addition to this, the content includes user-written examples and information. All material is subject to review and curation by the WPPaste.com community.