GC_Customize_Widgets::tally_sidebars_via_dynamic_sidebar_calls()
最后更新于:2021-11-27 12:51:29
GC_Customize_Widgets::tally_sidebars_via_dynamic_sidebar_calls( bool$has_widgets, string$sidebar_id)Tallies the sidebars rendered via dynamic_sidebar().
参数
- $has_widgets
-
(bool) (Required) Whether the current sidebar has widgets.
- $sidebar_id
-
(string) (Required) Sidebar ID.
响应
(bool) Whether the current sidebar has widgets.
源文件
文件: gc-includes/class-gc-customize-widgets.php
public function tally_sidebars_via_dynamic_sidebar_calls( $has_widgets, $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 'is_active_sidebar' if we want to ensure there is an area to
* drop widgets into, if the sidebar is empty.
*/
return $has_widgets;
}