This week only. Pastebin PRO Accounts Christmas Special! Don't miss out!Want more features on Pastebin? Sign Up, it's FREE!
Guest

Untitled

By: a guest on Oct 25th, 2013  |  syntax: None  |  size: 0.56 KB  |  views: 38  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. function panel_strip_comic_image( $content ) {
  2.         if ( class_exists( 'Jetpack_Comic' ) && ( Jetpack_Comic::POST_TYPE === get_post_type() ) && has_post_thumbnail() ) {
  3.                 $image_url = wp_get_attachment_image_src( get_post_thumbnail_id(), 'full' )[0];
  4.                 $image_url = str_replace( array( 'http://', 'https://' ), 'https?://', $image_url );
  5.                 $regex     = sprintf( '#<a href="%1$s"><img[^>]*? src="%1$s[^"]*" [^>]*?/></a>#', $image_url );
  6.                 $content   = preg_replace( $regex, '', $content );
  7.         }
  8.  
  9.         return $content;
  10. }
  11. add_filter( 'the_content', 'panel_strip_comic_image' );
clone this paste RAW Paste Data