WP_Customize_Custom_CSS_Setting::__construct() WordPress Method

The WP_Customize_Custom_CSS_Setting::__construct() method is used to create a new custom CSS setting object. This setting allows you to specify a CSS rule that will be applied to a WordPress site.

WP_Customize_Custom_CSS_Setting::__construct( WP_Customize_Manager $manager, string $id, array $args = array() ) #

WP_Customize_Custom_CSS_Setting constructor.


Parameters

$manager

(WP_Customize_Manager)(Required)Customizer bootstrap instance.

$id

(string)(Required)A specific ID of the setting. Can be a theme mod or option name.

$args

(array)(Optional)Setting arguments.

Default value: array()


Top ↑

Source

File: wp-includes/customize/class-wp-customize-custom-css-setting.php

	public function __construct( $manager, $id, $args = array() ) {
		parent::__construct( $manager, $id, $args );
		if ( 'custom_css' !== $this->id_data['base'] ) {
			throw new Exception( 'Expected custom_css id_base.' );
		}
		if ( 1 !== count( $this->id_data['keys'] ) || empty( $this->id_data['keys'][0] ) ) {
			throw new Exception( 'Expected single stylesheet key.' );
		}
		$this->stylesheet = $this->id_data['keys'][0];
	}


Top ↑

Changelog

Changelog
VersionDescription
4.7.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.