Skip to content

Instantly share code, notes, and snippets.

@emiluzelac
Created March 30, 2017 21:47
Show Gist options
  • Save emiluzelac/32d53ab85c05cda846ad61590588a7bb to your computer and use it in GitHub Desktop.
Save emiluzelac/32d53ab85c05cda846ad61590588a7bb to your computer and use it in GitHub Desktop.
Escape translated strings
/**
* Escape translated strings with:
*/
__( ‘Hello world’, ‘text-domain’ ); _e( ‘Hello world’, ‘text-domain’ );.
/**
* If there is no HTML use:
*/
esc_html__( ‘Hello world’, ‘text-domain’ ); esc_html_e( ‘Hello world’, ‘text-domain’ );
/**
* When there's some HTML use:
*/
wp_kses( __( ‘Hello world’, ‘text-domain’ ), $allowed_html_array );
@islamroshan
Copy link

i am currently working with codeigniter can i use html_escape?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment