Skip to content

Commit

Permalink
AMP: check if class exists before to use it. (#12140)
Browse files Browse the repository at this point in the history
This is a follow-up to #12139 for more files in sync with WordPress.com.
  • Loading branch information
jeherve authored Apr 24, 2019
1 parent a9fc6fd commit 0d600fe
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
5 changes: 4 additions & 1 deletion modules/likes.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down
5 changes: 4 additions & 1 deletion modules/widgets/contact-info.php
Original file line number Diff line number Diff line change
Expand Up @@ -343,7 +343,10 @@ function build_map( $address, $api_key = null ) {

$iframe_html = sprintf( '<iframe width="600" %s></iframe>', $iframe_attributes );

if ( ! Jetpack_AMP_Support::is_amp_request() ) {
if (
! class_exists( 'Jetpack_AMP_Support' )
|| ! Jetpack_AMP_Support::is_amp_request()
) {
return $iframe_html;
}

Expand Down

0 comments on commit 0d600fe

Please sign in to comment.