From 4970b3d43d01bfc0aa98c1ffd475b1dd6a02c1fc Mon Sep 17 00:00:00 2001 From: Jeremy Herve Date: Wed, 24 Apr 2019 16:23:25 +0200 Subject: [PATCH] AMP: check if class exists before to use it. This is a follow-up to #12139 for more files in sync with WordPress.com. --- modules/likes.php | 5 ++++- modules/widgets/contact-info.php | 5 ++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/modules/likes.php b/modules/likes.php index cc178ca772848..efc264d7ff0c3 100644 --- a/modules/likes.php +++ b/modules/likes.php @@ -263,7 +263,10 @@ function action_init() { return; } - if ( Jetpack_AMP_Support::is_amp_request() ) { + if ( + class_exists( 'Jetpack_AMP_Support' ) + && Jetpack_AMP_Support::is_amp_request() + ) { return; } diff --git a/modules/widgets/contact-info.php b/modules/widgets/contact-info.php index 7a0a373e5515a..93b4695b95c8c 100644 --- a/modules/widgets/contact-info.php +++ b/modules/widgets/contact-info.php @@ -343,7 +343,10 @@ function build_map( $address, $api_key = null ) { $iframe_html = sprintf( '', $iframe_attributes ); - if ( ! Jetpack_AMP_Support::is_amp_request() ) { + if ( + ! class_exists( 'Jetpack_AMP_Support' ) + || ! Jetpack_AMP_Support::is_amp_request() + ) { return $iframe_html; }