GC_Customize_Widgets::tally_sidebars_via_is_active_sidebar_calls()

最后更新于:2021-11-27 12:55:25

GC_Customize_Widgets::tally_sidebars_via_is_active_sidebar_calls( bool$is_active, string$sidebar_id)

Tallies the sidebars rendered via is_active_sidebar().

参数

$is_active

(bool) (Required) Whether the sidebar is active.

$sidebar_id

(string) (Required) Sidebar ID.

响应

(bool) Whether the sidebar is active.

源文件

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

	public function tally_sidebars_via_is_active_sidebar_calls( $is_active, $sidebar_id ) {
		if ( is_registered_sidebar( $sidebar_id ) ) {
			$this->rendered_sidebars[ $sidebar_id ] = true;
		}

		/*
		 * We may need to force this to true, and also force-true the value
		 * for 'dynamic_sidebar_has_widgets' if we want to ensure that there
		 * is an area to drop widgets into, if the sidebar is empty.
		 */
		return $is_active;
	}