Instantly share code, notes, and snippets.

Embed
What would you like to do?
Escaping for textarea values while leaving both double and single quotes unconverted.
<?php
/**
* Escaping for textarea values while leaving both double and single quotes unconverted.
*
* @param string $text
* @return string
*/
function theme_slug_esc_text( $text ) {
return htmlspecialchars( $text, ENT_NOQUOTES, get_option( 'blog_charset' ) );
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment