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

WP_Customize_Manager::add_panel() WP 4.0.0

Add a customize panel.

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

Хуков нет.

Возвращает

WP_Customize_Panel. The instance of the panel that was added.

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

$WP_Customize_Manager = new WP_Customize_Manager();
$var = $WP_Customize_Manager->add_panel( $id, $args );
$id(WP_Customize_Panel/строка) (обязательный)
Customize Panel object, or Panel ID.
$args(массив)

Array of properties for the new Panel object.

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

  • $capability (строка)
    Capability required for the panel. Default edit_theme_options

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

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

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

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

  • $active_callback (callable)
    Active callback.

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

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

С версии 4.0.0 Введена.
С версии 4.5.0 Return added WP_Customize_Panel instance.

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

<?php
public function add_panel( $id, $args = array() ) {
	if ( $id instanceof WP_Customize_Panel ) {
		$panel = $id;
	} else {
		$panel = new WP_Customize_Panel( $this, $id, $args );
	}

	$this->panels[ $panel->id ] = $panel;
	return $panel;
}