Skip to content

Instantly share code, notes, and snippets.

@Flimm
Created September 5, 2018 09:30
Show Gist options
  • Save Flimm/2f127cf9731564e121d8381a355bbe51 to your computer and use it in GitHub Desktop.
Save Flimm/2f127cf9731564e121d8381a355bbe51 to your computer and use it in GitHub Desktop.
Examples of wp_specialchars_decode calls
<?php
echo( wp_specialchars_decode( "He's been \"busy\", very busy." ) );
// He's been "busy", very busy.
echo( wp_specialchars_decode( "He&#39;s been &#34;busy&#34;, &lt;i&gt;very&lt;/i&gt; busy." ) ); // defaults to ENT_NOQUOTES
// He&#39;s been &#34;busy&#34;, <i>very</i> busy.
echo( wp_specialchars_decode( "He&#39;s been &#34;busy&#34;, &lt;i&gt;very&lt;/i&gt; busy.", ENT_COMPAT ) );
// He&#39;s been "busy", <i>very</i> busy.
echo( wp_specialchars_decode( "He&#39;s been &#34;busy&#34;, &lt;i&gt;very&lt;/i&gt; busy.", ENT_QUOTES ) );
// He's been "busy", <i>very</i> busy.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment