Astra_Addon_AMP_Compatibility::custom_layout_disable_on_amp( boolean $status, int $post_id )

Disable Custom Layout on frontend if it is disabled on AMP.


Description


Parameters

$status

(boolean) (Required) Status true if layout is tobe displayed on the frontend. False is it should not be rendered.

$post_id

(int) (Required) Post ID which is to be rendered from the Custom Layout.


Return

(boolean.)


Source

File: classes/compatibility/class-astra-addon-amp-compatibility.php

	public function custom_layout_disable_on_amp( $status, $post_id ) {
		$amp_status = get_post_meta( $post_id, 'amp_status', true );
		if ( 'enabled' === $amp_status || '' === $amp_status ) {
			$status = true;
		} else {
			$status = false;
		}

		return $status;
	}

Changelog

Changelog
Version Description
1.7.0 Introduced.

User Contributed Notes

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