GC_Customize_Manager::add_section()

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

GC_Customize_Manager::add_section( GC_Customize_Section|string$id, array$args=array())

Add a customize section.

参数

$id

(GC_Customize_Section|string) (Required) Customize Section object, or ID.

$args

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

Default value: array()

响应

(GC_Customize_Section) The instance of the section that was added.

源文件

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

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

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