GC_Customize_Manager::add_panel()

最后更新于:2021-11-27 00:45:04

GC_Customize_Manager::add_panel( GC_Customize_Panel|string$id, array$args=array())

Add a customize panel.

参数

$id

(GC_Customize_Panel|string) (Required) Customize Panel object, or ID.

$args

(array) (Optional) Array of properties for the new Panel object. See GC_Customize_Panel::__construct() for information on accepted arguments.

Default value: array()

响应

(GC_Customize_Panel) The instance of the panel that was added.

源文件

文件: gc-includes/class-gc-customize-manager.php

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

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