WordPress at a glance

tag_escape() WP 1.0

Escape an HTML tag name.

✈ 1 time = 0.000074s = very fast | 50000 times = 0.08s = speed of light
Hooks from function:
Return

String.

Usage

tag_escape( $tag_name );
$tag_name(string) (required)

Code of tag_escape: wp-includes/formatting.php VER 4.9.8

<?php
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

No comments
    Hello, !     Log In . Register