Add Filter to the content before is display

Marketplace Forums Themes Treeson Treeson Premium Add Filter to the content before is display

This topic contains 0 replies, has 1 voice, and was last updated by  mythemes 6 years, 9 months ago.

Viewing 1 post (of 1 total)
  • Author
    Posts
  • #3183

    mythemes
    Member

    filter is placed here:

    treeson_/functions.php line 29
    filter: add_filter( 'the_content', array( 'mythemes_tools' , 'the_content' ) );

    function “mythemes_tools/the_content” is placed here:

    treeson_/lib/mythemes.tools.class.php line 143 - 177

    static function the_content( $content ){
    
        $content = str_replace( "<br /></p>", "</p>", $content );
        $content = str_replace( "<br />\n</p>", "</p>", $content );
    
        $content = str_replace( "<p></p>", "", $content );
        $content = str_replace( "<p><p>", "<p>", $content );
        $content = str_replace( "</p></p>", "</p>", $content );
    
        $content = str_replace( "<p><h", "<h", $content );
        $content = str_replace( "h></p>", "h>", $content );
    
        $content = str_replace( "<p><img", "<img", $content );
        $content = str_replace( "/></p>", "/>", $content );
    
        $content = str_replace( "<br />\n<h", "<h", $content );
        $content = str_replace( "<br /><h", "<h", $content );
        $content = str_replace( "h><br />\n", "h>", $content );
        $content = str_replace( "h><br />", "h>", $content );
    
        $content = str_replace( "<p>[", "[", $content );
        $content = str_replace( "/]</p>", "/]", $content );
        $content = str_replace( "]</p>", "]", $content );
    
        $content = str_replace( "<br />[", "[", $content );
        $content = str_replace( "<br />\n[", "[", $content );
    
        $content = str_replace( "/]<br />", "/]", $content );
        $content = str_replace( "/]<br />\n", "/]", $content );
    
        $content = str_replace( "]<br />", "]", $content );
        $content = str_replace( "]<br />\n", "]", $content );
    
        return $content;
    }
    
Viewing 1 post (of 1 total)

You must be logged in to reply to this topic.

[email protected]