WordPress как на ладони
Недорогой хостинг для сайтов на WordPress: wordpress.jino.ru Получай пассивный доход от сайта
функция не описана

WP_Customize_Manager::add_setting() public WP 3.4.0

Add a customize setting.

{} Это метод класса: WP_Customize_Manager{}

Возвращает

WP_Customize_Setting. The instance of the setting that was added.

Использование

$WP_Customize_Manager = new WP_Customize_Manager();
$WP_Customize_Manager->add_setting( $id, $args );
$id(WP_Customize_Setting|строка) (обязательный)
Customize Setting object, or ID.
$args(массив)
Array of properties for the new Setting object. See WP_Customize_Setting::__construct() for information on accepted arguments.
По умолчанию: empty array

Заметки

Список изменений

С версии 3.4.0 Введена.
С версии 4.5.0 Return added WP_Customize_Setting instance.

Код WP_Customize_Manager::add_setting() WP 5.8

<?php
public function add_setting( $id, $args = array() ) {
	if ( $id instanceof WP_Customize_Setting ) {
		$setting = $id;
	} else {
		$class = 'WP_Customize_Setting';

		/** This filter is documented in wp-includes/class-wp-customize-manager.php */
		$args = apply_filters( 'customize_dynamic_setting_args', $args, $id );

		/** This filter is documented in wp-includes/class-wp-customize-manager.php */
		$class = apply_filters( 'customize_dynamic_setting_class', $class, $id, $args );

		$setting = new $class( $this, $id, $args );
	}

	$this->settings[ $setting->id ] = $setting;
	return $setting;
}