Skip to content

Instantly share code, notes, and snippets.

@tychay
Created April 24, 2015 02:58
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tychay/fa3490ba5eae5ec8df68 to your computer and use it in GitHub Desktop.
Save tychay/fa3490ba5eae5ec8df68 to your computer and use it in GitHub Desktop.
Attempted patch to https://github.com/kylereicks/picturefill.js.wp/issues/47 so that picturefill doesn't mess with rss feeds.
<?php
function apply_picturefill_to_content_not_feed($html, $cache = null) {
if ( is_feed() ) { return $html; }
return Picturefill_WP::get_instance()->picturefill_wp_apply_to_html($html, $cache);
}
remove_filter( 'the_content', array( Picturefill_WP::get_instance(), 'picturefill_wp_apply_to_html' ), apply_filters('picturefill_wp_the_content_filter_priority', 11) );
add_filter ( 'the_content, 'apply_picturefill_to_content_not_feed', apply_filters('picturefill_wp_the_content_filter_priority', 11) );
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment