Skip to content

Commit

Permalink
AMP: check if class exists before to use it.
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 committed Apr 24, 2019
1 parent 999132f commit 4970b3d
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 4970b3d

Please sign in to comment.