From 64a5885853bfc266ca86cf81df65e22dbc066424 Mon Sep 17 00:00:00 2001 From: Robin Cornett Date: Fri, 17 May 2019 18:00:05 -0400 Subject: [PATCH] Improve intro text output --- ...isplayfeaturedimagegenesis-description.php | 28 ++++++++++++++++++- 1 file changed, 27 insertions(+), 1 deletion(-) diff --git a/includes/output/class-displayfeaturedimagegenesis-description.php b/includes/output/class-displayfeaturedimagegenesis-description.php index cdd6f80..8f61543 100644 --- a/includes/output/class-displayfeaturedimagegenesis-description.php +++ b/includes/output/class-displayfeaturedimagegenesis-description.php @@ -245,8 +245,34 @@ class Display_Featured_Image_Genesis_Description { protected function print_description( $intro_text, $class = '', $context = 'archive_intro' ) { printf( '
', esc_html( $class ) ); do_action( "displayfeaturedimagegenesis_before_{$context}" ); - echo wp_kses_post( wpautop( $intro_text ) ); + $intro_text = $this->get_content( $intro_text ); + // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped + echo $intro_text; do_action( "displayfeaturedimagegenesis_after_{$context}" ); echo '
'; } + + /** + * Run the intro text (content) through standard filters. + * + * @param $content + * + * @return string + * @since 3.1.0 + */ + private function get_content( $content ) { + global $wp_embed; + $original = $content; + $content = trim( $content ); + $content = wptexturize( $content ); + $content = wpautop( $content ); + $content = shortcode_unautop( $content ); + $content = prepend_attachment( $content ); + $content = convert_smilies( $content ); + $content = wp_make_content_images_responsive( $content ); + $content = $wp_embed->autoembed( $content ); + $content = do_shortcode( $content ); + + return apply_filters( 'displayfeaturedimagegenesis_intro_text', $content, $original ); + } }