astra_with_third_party( bool $is_sidebar_option = false )

Check if the current page is a third party page.


Description


Parameters

$is_sidebar_option

(bool) (Optional) Whether to check sidebar option needed for Lifterlms case.

Default value: false


Return

(string|bool) Returns the name of third party if page belongs to any, otherwise returns false.


Source

File: inc/markup-extras.php

function astra_with_third_party( $is_sidebar_option = false ) {

	$post_type = strval( get_post_type() );

	/** @psalm-suppress UndefinedFunction */
	if ( class_exists( 'WooCommerce' ) && ( is_woocommerce() || is_checkout() || is_cart() || is_account_page() ) ) {
		return 'woocommerce';
	}
	/** @psalm-suppress UndefinedFunction */
	elseif ( class_exists( 'Easy_Digital_Downloads' ) && astra_is_edd_page() ) {
		return 'edd';
	}
	/** @psalm-suppress UndefinedFunction */
	elseif ( class_exists( 'LifterLMS' ) && ( is_lifterlms() || is_llms_account_page() || is_llms_checkout() ) ) {
		if ( $is_sidebar_option && ( is_lesson() || is_course() ) ) {
			return 'lifterlms-course-lesson';
		}
		return 'lifterlms';
	} elseif ( class_exists( 'SFWD_LMS' ) && in_array( $post_type, array( 'sfwd-courses', 'sfwd-lessons', 'sfwd-topic', 'sfwd-quiz', 'sfwd-certificates', 'sfwd-assignment' ) ) ) {
		return 'learndash';
	}

	return false;
}

Changelog

Changelog
Version Description
4.2.0 Introduced.


User Contributed Notes

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