Undoing a strip_tags in php

I am trying to customize a Word press template and having some trouble. The page is http://rexonmedia.com/?page_id=113 and under each section there are description, all the text in description is plain text(Actionscript, Visit site …). I want the text to be formatted or have links like the source (http://rexonmedia.com/?portfolio=audiomaya) with hyperlink.

I came to find out that the culprit here is “strip_tags” tags. It’s used on two different places. I tried couple of scenarios but didn’t work. Please help

   public function customFormat($content,$strip_tags = false,$shortcode=true){
   $content =   stripslashes($content);
   if($shortcode)
   $content = do_shortcode( shortcode_unautop( $content ) ); 
   $content = preg_replace('#^</p>|^<brs?/?>|<p>$|<p>s*(&nbsp;)?s*</p>#', '', $content);

   if($strip_tags)
     $content = strip_tags($content,"<hades>,<tabend>");

   return $content;

    }   

<?php  
global $more;    // Declare global $more (before the loop).
    $more = 1;
$content = get_the_content('');
$content = apply_filters('the_content', $content);
    $content = str_replace(']]>', ']]&gt;', $content);
$this->shortenContent( $content_limit ,  strip_tags( $content  ) ); 
?>

Related posts

Leave a Reply

1 comment

  1. Supply strip_tags with the allowable tags. The line in the first block of code would change to:

    $content = strip_tags($content,"<strong><a>");
    

    And the line in the second block of code would change to:

    $this->shortenContent( $content_limit ,  strip_tags( $content, "<strong><a>" ) ); 
    

    By the way, the function defines $strip_tags as false in the function definition if it is not supplied. Check that!

    public function customFormat($content,$strip_tags = false,$shortcode=true){