Skip to content

Commit

Permalink
Merge branch 'hf-lazyload-rest'
Browse files Browse the repository at this point in the history
  • Loading branch information
cjg89 committed Mar 3, 2020
2 parents 25b3950 + 383c944 commit cacb450
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions includes/config.php
Original file line number Diff line number Diff line change
Expand Up @@ -583,3 +583,23 @@ function yoast_sitemap_empty_terms( $hide_empty, $taxonomies ) {
}

add_filter( 'wpseo_sitemap_exclude_empty_terms', 'yoast_sitemap_empty_terms', 10, 2 );


/**
* Prevent the Lazy Loader plugin from modifying contents of REST API feeds.
*
* @since v3.3.9
* @author Jo Dickson
*/
function disable_lazyload_in_rest() {
global $lazy_loader;

if (
isset( $lazy_loader )
&& $lazy_loader instanceof FlorianBrinkmann\LazyLoadResponsiveImages\Plugin
) {
remove_filter( 'the_content', array( $lazy_loader, 'filter_markup' ), 10001 );
}
}

add_action( 'rest_api_init', 'disable_lazyload_in_rest' );

0 comments on commit cacb450

Please sign in to comment.