CoreFiles by mySites.guru
class-wp-customize-sidebar-section.php58 lines, 1,059 bytes, from wordpress-5.2.21.zip
Raw History Compare with 5.2.20
md5
566aafbd42e1e1a2dbd8b1f4c5c18571
sha1
c4db1893d8af0c1f79ef60b9ba41f443851f14e9
sha256
0cd74a4ddeb9251788a2588fbefb586c87da1d6b320263f60fe64070f2430523
<?php
/**
 * Customize API: WP_Customize_Sidebar_Section class
 *
 * @package WordPress
 * @subpackage Customize
 * @since 4.4.0
 */

/**
 * Customizer section representing widget area (sidebar).
 *
 * @since 4.1.0
 *
 * @see WP_Customize_Section
 */
class WP_Customize_Sidebar_Section extends WP_Customize_Section {

	/**
	 * Type of this section.
	 *
	 * @since 4.1.0
	 * @var string
	 */
	public $type = 'sidebar';

	/**
	 * Unique identifier.
	 *
	 * @since 4.1.0
	 * @var string
	 */
	public $sidebar_id;

	/**
	 * Gather the parameters passed to client JavaScript via JSON.
	 *
	 * @since 4.1.0
	 *
	 * @return array The array to be exported to the client as JSON.
	 */
	public function json() {
		$json              = parent::json();
		$json['sidebarId'] = $this->sidebar_id;
		return $json;
	}

	/**
	 * Whether the current sidebar is rendered on the page.
	 *
	 * @since 4.1.0
	 *
	 * @return bool Whether sidebar is rendered.
	 */
	public function active_callback() {
		return $this->manager->widgets->is_sidebar_rendered( $this->sidebar_id );
	}
}

The same content is in 596 releases, WordPress 5.1-beta1 to 7.2-beta5. See them all, or every version of this file.