Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

My goal is to unescape the string.

So, how would I do it in Wordpress? Let's say I have the whole string below:

He said, “This is how it works...”

I can't seem to find a built-in Wordpress function to unescape “ and ”. This is if using unescape on the_title() (sorry for not specifying earlier).

On the rss feed items, I have this code where the_title() should be unescaped:

<item>
  <title><![CDATA[<?php the_title(); ?>]]></title>
  <link><?php echo get_permalink(); ?></link>
  <date><?php the_time(get_option('date_format')); ?></date>
</item>
share|improve this question
    
check this link hope this will help you codex.wordpress.org/Data_Validation –  Ravs Jul 12 '13 at 18:26
add comment

1 Answer

up vote 1 down vote accepted

I don't think there is one. Escaping is harder than unescaping (you have decide what exactly to escape and where).

Just use PHP html_entity_decode function.

share|improve this answer
    
You are actually right that this works. I guess I stated the wrong question. I actually tried stripslashes, stripcslashes, and html_entity_decode on the_title(). But it does not work this way. +1 for help. –  Franz Noel Jul 12 '13 at 19:22
    
And why are these chars escaped in the_title()? What exactly are you doing? –  Krzysiek Dróżdż Jul 12 '13 at 19:25
    
I was using <![CDATA[<?php the_title(); ?>]]> inside the items of RSS feed. –  Franz Noel Jul 12 '13 at 19:30
    
OK, but the_title() should not escape anything by itself, AFAIR... –  Krzysiek Dróżdż Jul 12 '13 at 19:36
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.