Astra_SureCart::astra_is_surecart_shop_page()

Check is SureCart Shop Page.


Description


Return

(bool) True if SureCart Shop Page.


Source

File: inc/compatibility/class-astra-surecart.php

	public function astra_is_surecart_shop_page() {
		if ( ! is_customize_preview() && ! is_null( $this->shop_page_status ) ) {
			return $this->shop_page_status;
		}

		$this->shop_page_status = false;
		$supported_post_types   = Astra_Posts_Structure_Loader::get_supported_post_types();
		if ( ! in_array( $this->post_type, $supported_post_types ) ) {
			$this->shop_page_status = false;
		}

		if ( ! is_page() || ! $this->shop_page_id ) {
			$this->shop_page_status = false;
		}

		$page_id = absint( astra_get_post_id() );
		if ( $page_id === $this->shop_page_id ) {
			$this->shop_page_status = true;
		}

		return $this->shop_page_status;
	}

Changelog

Changelog
Version Description
4.4.0 Introduced.


User Contributed Notes

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