tag_escape() – Escape an HTML tag name.

You appear to be a bot. Output may be restricted

Description

Escapes an HTML tag name.

Usage

$string = tag_escape( $tag_name );

Parameters

$tag_name
( string ) required

Returns

string

Source

File name: wordpress/wp-includes/formatting.php
Lines:

1 to 12 of 12
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 );
}
 

 View on GitHub View on Trac