tag_escape() WP 1.0
Escape an HTML tag name.
1 time = 0.000001s = speed of light | 50000 times = 0.05s = speed of light | PHP 7.2.16, WP 5.2
Hooks from the function
Return
String.
Usage
tag_escape( $tag_name );
- $tag_name(string) (required)
Changelog
Since 2.5.0 | Introduced. |
Code of tag_escape() tag escape WP 5.6
function tag_escape( $tag_name ) {
$safe_tag = strtolower( preg_replace( '/[^a-zA-Z0-9_:]/', '', $tag_name ) );
/**
* Filters a string cleaned and escaped for output as an HTML tag.
*
* @since 2.8.0
*
* @param string $safe_tag The tag name after it has been escaped.
* @param string $tag_name The text before it was escaped.
*/
return apply_filters( 'tag_escape', $safe_tag, $tag_name );
}Related Functions
From tag: esc_ (clean validate sanitize)
More from category: Sanitizing, Escaping
- sanitize_email()
- sanitize_file_name()
- sanitize_html_class()
- sanitize_option()
- sanitize_post_field()
- sanitize_text_field()