vendredi 3 juin 2016

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.



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire