Skip to content

Commit

Permalink
Change wp_make_content_images_responsive to wp_filter_content_tags (#…
Browse files Browse the repository at this point in the history
…21514)

* Change wp_make_content_images_responsive to wp_filter_content_tags

* Swap second place where wp_make_content_images_responsive is used

* Add pre 5.5 support fallback
  • Loading branch information
johnstonphilip authored Apr 20, 2020
1 parent e9ec75b commit fa16fa3
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
6 changes: 5 additions & 1 deletion lib/template-loader.php
Original file line number Diff line number Diff line change
Expand Up @@ -265,7 +265,11 @@ function gutenberg_render_the_template() {
$content = $wp_embed->autoembed( $content );
$content = do_blocks( $content );
$content = wptexturize( $content );
$content = wp_make_content_images_responsive( $content );
if ( function_exists( 'wp_filter_content_tags' ) ) {
$content = wp_filter_content_tags( $content );
} else {
$content = wp_make_content_images_responsive( $content );
}
$content = str_replace( ']]>', ']]>', $content );

// Wrap block template in .wp-site-blocks to allow for specific descendant styles
Expand Down
6 changes: 5 additions & 1 deletion packages/block-library/src/template-part/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,11 @@ function render_block_core_template_part( $attributes ) {
$content = convert_smilies( $content );
$content = wpautop( $content );
$content = shortcode_unautop( $content );
$content = wp_make_content_images_responsive( $content );
if ( function_exists( 'wp_filter_content_tags' ) ) {
$content = wp_filter_content_tags( $content );
} else {
$content = wp_make_content_images_responsive( $content );
}
$content = do_shortcode( $content );

return str_replace( ']]>', ']]>', $content );
Expand Down

0 comments on commit fa16fa3

Please sign in to comment.