• Resolved john3carry3

    (@john3carry3)


    Hello!
    While searching from search bar it shows product description with html tags.
    I tried to fix it with editing the following file.
    wp-content/plugins/advanced-product-search-for-woo/includes/classes/classes-search.php

    I have added strip_tags() in following function.

    public function apsw_ajax_data_content( $id ){
    		$content = '';
    		if( apply_filters( 'apws_show_description', $this->option_search_results['show_description'] )  == 'yes' ){
    			
    			if( $this->option_search_results['content_source'] == 'content' ){
    				$content = mb_strimwidth( esc_html( strip_tags(get_the_content( absint( $id ) )) ) ,0, absint( $this->option_search_results['length'] )  );
    			}else{
    				$scontent = mb_strimwidth( esc_html( strip_tags(get_the_excerpt( absint( $id ) )) ) ,0, absint( $this->option_search_results['length'] )  );
    			}
    		}
    		return $content;	
    	}

    Please add this change to your plugin so we can get future plugin updates without breaking things. Or please let me know how to extend this to functions.php so i can have this issue fixed.

    Thank you,

Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
  • The topic ‘Search results shows HTML tags’ is closed to new replies.