• Hello,

    How can i unset excerpt HTML stripping with custom function of mine,so i don’t have to mess with core functionality?

    This is the call on the line 585 located at elasticpress/classes/class-ep-api.php:

    'post_excerpt' => $this->prepare_text_content( $post->post_excerpt ),

    Function location – line 628:

    private function prepare_text_content( $content ) {
    	$content = strip_tags( $content );
    	$content = preg_replace( '#[\n\r]+#s', ' ', $content );
    
    	return $content;
    }

    I dont want to strip HTML from excerpt,reason is that i dont use Featured images for my posts cause im creating affiliate website and importing a lot of products,so im putting affiliate external images into excerpts so i can display them in categories,tags,search archive pages.

    Thanks in advance!

    • This topic was modified 7 years, 5 months ago by mrVlad.
    • This topic was modified 7 years, 5 months ago by mrVlad.
    • This topic was modified 7 years, 5 months ago by mrVlad.
    • This topic was modified 7 years, 5 months ago by mrVlad.
  • The topic ‘Allow HTML in Excerpt’ is closed to new replies.