Astra_Posts_Archive_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.


Return

(mixed)


Source

File: inc/modules/posts-structures/customizer/class-astra-posts-archive-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 . '[archive-' . $post_type . '-content-layout]',
					'operator' => '!=',
					'value'    => 'narrow-container',
				),
				array(
					'relation' => 'OR',
					array(
						'setting'  => ASTRA_THEME_SETTINGS . '[archive-' . $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;
		}
	}

Changelog

Changelog
Version Description
4.0.0 Introduced.

User Contributed Notes

You must log in before being able to contribute a note or feedback.