Astra_Addon_AMP_Compatibility::custom_layout_disable_on_amp( bool $status, int $post_id )
Disable Custom Layout on frontend if it is disabled on AMP.
Description
Parameters
- $status
-
(bool) (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
(bool.)
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;
}
Expand full source code Collapse full source code View on Trac
Changelog
| Version | Description |
|---|---|
| 1.7.0 | Introduced. |