| 1 |
<?php |
| 2 |
defined( 'ABSPATH' ) || exit; |
| 3 |
|
| 4 |
/** |
| 5 |
* Compatibility with AMP plugin from WordPress.com VIP. |
| 6 |
*/ |
| 7 |
if ( function_exists( 'is_amp_endpoint' ) ) : |
| 8 |
|
| 9 |
add_filter( 'imagify_allow_picture_tags_for_nextgen', 'imagify_amp_disable_picture_on_endpoint' ); |
| 10 |
/** |
| 11 |
* Do not use <picture> tags in AMP pages. |
| 12 |
* |
| 13 |
* @since 1.9 |
| 14 |
* |
| 15 |
* @param bool $allow True to allow the use of <picture> tags (default). False to prevent their use. |
| 16 |
* @return bool |
| 17 |
*/ |
| 18 |
function imagify_amp_disable_picture_on_endpoint( $allow ) { |
| 19 |
return $allow && ! is_amp_endpoint(); |
| 20 |
} |
| 21 |
|
| 22 |
endif; |
| 23 |
|