Strip_tags doesn’t work in get_the_content

I’m trying to make a wordpress plugin but not working and do not know what can be. The plugin should take posts by get_the_content but with formatting.

<?php
register_activation_hook('__FILE__', 'texto');
add_filter ('the_content', 'texto');
   function texto ($text){
      $text = get_the_content( '' );
      $text = apply_filters( 'the_content', $text );
     $text = strip_tags( $text, '<p></br>' );
     return  $text;
    };

?>

This is not working. With $text = apply_filters ('the_content', $ text); the blog does not load, if I take $text = apply_filters ('the_content', $ text); posts have no formatting.

Related posts

Leave a Reply

1 comment