Files
medicalalert-web-reloaded/wp/wp-content/plugins/imagify/inc/3rd-party/amp/amp.php
Tony Volpe 4eb982d7a8 Merged in feature/from-pantheon (pull request #16)
code from pantheon

* code from pantheon
2024-01-10 17:03:02 +00:00

24 lines
606 B
PHP
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<?php
defined( 'ABSPATH' ) || die( 'Cheatin uh?' );
/**
* Compatibility with AMP plugin from WordPress.com VIP.
*/
if ( function_exists( 'is_amp_endpoint' ) ) :
add_filter( 'imagify_allow_picture_tags_for_webp', 'imagify_amp_disable_picture_on_endpoint' );
/**
* Do not use <picture> tags in AMP pages.
*
* @since 1.9
* @author Grégory Viguier
*
* @param bool $allow True to allow the use of <picture> tags (default). False to prevent their use.
* @return bool
*/
function imagify_amp_disable_picture_on_endpoint( $allow ) {
return $allow && ! is_amp_endpoint();
};
endif;