astra_addon_check_reveal_effect_condition( string $type = '' )

Checks reveal effect option for blog , WooCommerce and for custom post type.


Description


Parameters

$type

(string) (Optional) - Type of condition.

Default value: ''


Return

(bool)


Source

File: classes/astra-common-functions.php

function astra_addon_check_reveal_effect_condition( $type = '' ) {
	$supported_post_types    = Astra_Posts_Structure_Loader::get_supported_post_types();
	$post_type               = strval( get_post_type() );
	$blog_layout             = astra_addon_get_blog_layout();
	$blog_list_layout        = ( 'blog-layout-2' === $blog_layout || 'blog-layout-3' === $blog_layout || 'blog-layout-5' === $blog_layout );
	$woo_reveal_condition    = ( function_exists( 'is_woocommerce' ) && is_woocommerce() && ( is_shop() || is_product_taxonomy() ) && astra_get_option( 'shop-reveal-effect' ) );
	$blog_reveal_condition   = ( ( ( is_front_page() && 'posts' === get_option( 'show_on_front' ) ) || is_category() || is_tag() || is_home() ) && astra_get_option( 'blog-reveal-effect' ) && ( $blog_list_layout || ! astra_get_option( 'blog-masonry' ) ) );
	$search_reveal_condition = ( is_search() && astra_get_option( 'blog-reveal-effect' ) );
	$custom_post_reveal      = in_array( $post_type, $supported_post_types ) && astra_get_option( 'archive-' . $post_type . '-ast-reveal-effect', false );
	$condition               = '';

	if ( '' === $type || 'all' === $type ) {
		$condition = $woo_reveal_condition || $blog_reveal_condition || $search_reveal_condition || $custom_post_reveal;
	}

	if ( 'blog' === $type ) {
		$condition = $blog_reveal_condition || $search_reveal_condition;
	}

	if ( 'woocommerce' === $type ) {
		$condition = $woo_reveal_condition;
	}

	if ( 'cpt' === $type ) {
		$condition = $custom_post_reveal;
	}

	return $condition;
}

Changelog

Changelog
Version Description
4.6.0 Introduced.


User Contributed Notes

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