WordPress at a glance
function is not described

WP_Customize_Section::__construct() public WP 3.4.0

Constructor.

Any supplied $args override class property defaults.

{} It's a method of the class: WP_Customize_Section{}

No Hooks.

Return

Null. Nothing.

Usage

$WP_Customize_Section = new WP_Customize_Section();
$WP_Customize_Section->__construct( $manager, $id, $args );
$manager(WP_Customize_Manager) (required)
Customizer bootstrap instance.
$id(string) (required)
A specific ID of the section.
$args(array)

Array of properties for the new Section object.

  • priority(int)
    Priority of the section, defining the display order of panels and sections.
    Default: 160

  • panel(string)
    The panel this section belongs to (if any).
    Default: ''

  • capability(string)
    Capability required for the section.
    Default: 'edit_theme_options'

  • theme_supports(string/string[])
    Theme features required to support the section.

  • title(string)
    Title of the section to show in UI.

  • description(string)
    Description to show in the UI.

  • type(string)
    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.
    Default: false

Default: empty array

Changelog

Since 3.4.0 Introduced.

Code of WP_Customize_Section::__construct() WP 5.5.3

<?php
public function __construct( $manager, $id, $args = array() ) {
	$keys = array_keys( get_object_vars( $this ) );
	foreach ( $keys as $key ) {
		if ( isset( $args[ $key ] ) ) {
			$this->$key = $args[ $key ];
		}
	}

	$this->manager = $manager;
	$this->id      = $id;
	if ( empty( $this->active_callback ) ) {
		$this->active_callback = array( $this, 'active_callback' );
	}
	self::$instance_count += 1;
	$this->instance_number = self::$instance_count;

	$this->controls = array(); // Users cannot customize the $controls array.
}