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

WP_Customize_Manager::add_section() WP 3.4.0

Add a customize section.

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

Хуков нет.


WP_Customize_Section. The instance of the section that was added.


$WP_Customize_Manager = new WP_Customize_Manager();
$var = $WP_Customize_Manager->add_section( $id, $args );
$id(WP_Customize_Section/строка) (обязательный)
Customize Section object, or Section ID.

Array of properties for the new Section object.

  • $priority (число)
    Priority of the section, defining the display order of panels and sections.
    По умолчанию: 160

  • $panel (строка)
    The panel this section belongs to (if any).
    По умолчанию: ''

  • $capability (строка)
    Capability required for the section.
    По умолчанию: 'edit_theme_options'

  • $theme_supports (строка/массив)
    Theme features required to support the section.

  • $title (строка)
    Title of the section to show in UI.

  • $description (строка)
    Description to show in the UI.

  • $type (строка)
    Type of the section.

  • $active_callback (callable)
    Active callback.

  • $description_hidden (true/false)
    Hide the description behind a help icon, instead of inline above the first control.
    По умолчанию: false

По умолчанию: empty array

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

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

Код WP Customize Manager::add section: wp-includes/class-wp-customize-manager.php WP 5.3

public function add_section( $id, $args = array() ) {
	if ( $id instanceof WP_Customize_Section ) {
		$section = $id;
	} else {
		$section = new WP_Customize_Section( $this, $id, $args );

	$this->sections[ $section->id ] = $section;
	return $section;