Astra_Posts_Single_Structures_Configs::get_sidebar_context( string $post_type )
Getting dynamic context for sidebar.
Description
Compatibility case: Narrow width + dynamic customizer controls.
Parameters
- $post_type
-
(string) (Required) On basis of this will decide to hide sidebar control or not.
Source
File: inc/modules/posts-structures/customizer/class-astra-posts-single-structures-configs.php
public function get_sidebar_context( $post_type ) {
if ( ! in_array( $post_type, Astra_Posts_Structures_Configs::get_narrow_width_exculde_cpts() ) ) {
return array(
'relation' => 'AND',
Astra_Builder_Helper::$general_tab_config,
array(
'setting' => ASTRA_THEME_SETTINGS . '[single-' . $post_type . '-content-layout]',
'operator' => '!=',
'value' => 'narrow-container',
),
array(
'relation' => 'OR',
array(
'setting' => ASTRA_THEME_SETTINGS . '[single-' . $post_type . '-content-layout]',
'operator' => '!=',
'value' => 'default',
),
array(
'setting' => ASTRA_THEME_SETTINGS . '[site-content-layout]',
'operator' => '!=',
'value' => 'narrow-container',
),
),
);
} else {
return Astra_Builder_Helper::$general_tab;
}
}
Expand full source code Collapse full source code View on Trac
Changelog
| Version | Description |
|---|---|
| 4.0.0 | Introduced. |