tag_escape example

 else {
                    $output .= wp_get_attachment_link( $att_id$atts['size'], false );
                }
            } else {
                $output .= wp_get_attachment_link( $att_id$atts['size'], true );
            }
            $output .= "\n";
        }
        return $output;
    }

    $itemtag    = tag_escape( $atts['itemtag'] );
    $captiontag = tag_escape( $atts['captiontag'] );
    $icontag    = tag_escape( $atts['icontag'] );
    $valid_tags = wp_kses_allowed_html( 'post' );
    if ( ! isset( $valid_tags[ $itemtag ] ) ) {
        $itemtag = 'dl';
    }
    if ( ! isset( $valid_tags[ $captiontag ] ) ) {
        $captiontag = 'dd';
    }
    if ( ! isset( $valid_tags[ $icontag ] ) ) {
        $icontag = 'dt';
    }

function get_tag_regex( $tag ) {
    if ( empty( $tag ) ) {
        return '';
    }
    return sprintf( '<%1$s[^<]*(?:>[\s\S]*<\/%1$s>|\s*\/>)', tag_escape( $tag ) );
}

/** * Retrieves a canonical form of the provided charset appropriate for passing to PHP * functions such as htmlspecialchars() and charset HTML attributes. * * @since 3.6.0 * @access private * * @see https://core.trac.wordpress.org/ticket/23688 * * @param string $charset A charset name. * @return string The canonical form of the charset. */
Home | Imprint | This part of the site doesn't use cookies.