-
-
Save richtabor/b1317517f53d7943c7f76da48c4468a3 to your computer and use it in GitHub Desktop.
More info: http://richtabor.com/themeforest-tips/
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// These are incorrect: | |
__( 'Some String', 'text-domain' ); _e( 'Some string', 'text-domain' ); | |
// Instead, use: | |
esc_html__( 'Some String', 'text-domain' ); esc_html_e( 'Some String', 'text-domain' ); | |
/** | |
* For strings with necessary HTML, use the following: | |
* Note that I'm only including the actual allowed HTML for this specific string. | |
* More info: https://codex.wordpress.org/Function_Reference/wp_kses | |
*/ | |
$allowed_html_array = array( | |
'a' => array( | |
'href' => array(), | |
), | |
'span' => array( | |
'class' => array(), | |
) | |
); | |
wp_kses( __( '<span class="powered-by"><a href="https://wordpress.org/">Proudly Powered by WordPress</a></span>', 'text-domain' ), $allowed_html_array ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment