astra_third_party_archive_meta( mixed $option )

WooCommerce, LifterLMS, EDD Archive (Shop, Courses, Memberships etc) Meta value.


Description


Parameters

$option

(mixed) (Required) name of the option to fetch.


Return

(mixed) meta_value


Source

File: inc/markup-extras.php

function astra_third_party_archive_meta( $option ) {

	$meta_value  = false;
	$third_party = astra_with_third_party( true );
	// Third party shop/archive page meta case.
	if ( 'woocommerce' === $third_party && ( is_shop() || is_product_taxonomy() ) ) {
		$shop_page_id = get_option( 'woocommerce_shop_page_id' );
		$meta_value   = get_post_meta( $shop_page_id, $option, true );
	} elseif ( 'lifterlms' === $third_party ) {
		/** @psalm-suppress UndefinedFunction */
		if ( is_courses() ) {
			$lifter_page_id = get_option( 'lifterlms_shop_page_id' );
			$meta_value     = get_post_meta( $lifter_page_id, $option, true );
		}
		/** @psalm-suppress UndefinedFunction */
		elseif ( is_memberships() ) {
			$lifter_page_id = get_option( 'lifterlms_memberships_page_id' );
			$meta_value     = get_post_meta( $lifter_page_id, $option, true );
		} elseif ( is_course_taxonomy() ) {
			$meta_value = 'default';
		}
	} elseif ( 'edd' === $third_party && astra_is_edd_single_page() ) {
		$page_id = get_the_ID();
		/** @psalm-suppress PossiblyFalseArgument */
		$meta_value = get_post_meta( $page_id, $option, true );
	}

	return $meta_value;
}

Changelog

Changelog
Version Description
4.2.0 Introduced.


User Contributed Notes

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