Skip to content

Commit

Permalink
On WPCOM use the WPCOM responsive images handlers
Browse files Browse the repository at this point in the history
  • Loading branch information
Copons committed Sep 26, 2019
1 parent 47f9898 commit 8834b9a
Showing 1 changed file with 8 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -203,12 +203,18 @@ public function output_template_content( $template_type ) {

// 10 priority
$content = wptexturize( $content );
// @todo maybe look at WPCOM_Responsive_Images for WPCom responsive image handling

// 11 priority
$content = do_shortcode( $content );

$content = prepend_attachment( $content );
$content = wp_make_content_images_responsive( $content );

if ( defined( 'IS_WPCOM' ) && IS_WPCOM && class_exists( '\WPCOM_Responsive_Images' ) ) {
$wpcom_responsive_images_instance = new \WPCOM_Responsive_Images();
$content = $wpcom_responsive_images_instance->make_content_images_responsive( $content );
} else {
$content = wp_make_content_images_responsive( $content );
}

// phpcs:disable WordPress.Security.EscapeOutput.OutputNotEscaped
echo $content;
Expand Down

0 comments on commit 8834b9a

Please sign in to comment.