Last active
May 16, 2020 18:22
-
-
Save richtabor/06c8f684e1eef24054798970d904b8df 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 | |
// Use anytime HTML element encloses a section of data: | |
echo esc_html( $no_html ); | |
// Use on all URLs, including those in the 'src' and 'href' attributes of an HTML element: | |
<img src="<?php echo esc_url( $escaped_url ); ?>" /> | |
// Use for inline Javascript: | |
<a href="#" onclick="<?php echo esc_js( $escaped_js ); ?>"><?php esc_html__( 'Click Here', 'text-domain' ); ?></a> | |
// Use for an HTML attribute: | |
<div class="<?php echo esc_attr( $escaped_class ); ?>"> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment