WPCF7_HTMLFormatter::normalize_start_tag
Normalizes a start tag.
Метод класса: WPCF7_HTMLFormatter{}
Хуков нет.
Возвращает
Массив. An array includes the normalized start tag and tag name.
Использование
$result = WPCF7_HTMLFormatter::normalize_start_tag( $tag );
- $tag(строка) (обязательный)
- A start tag or a tag name.
Код WPCF7_HTMLFormatter::normalize_start_tag() WPCF7 HTMLFormatter::normalize start tag CF7 6.1.5
public static function normalize_start_tag( $tag ) {
if ( preg_match( '/<(.+?)[\s\/>]/', $tag, $matches ) ) {
$tag_name = strtolower( $matches[1] );
} else {
$tag_name = strtolower( $tag );
$tag = sprintf( '<%s>', $tag_name );
}
if ( in_array( $tag_name, self::void_elements, true ) ) {
// Normalize void element.
$tag = preg_replace( '/\s*\/?>/', ' />', $tag );
}
return array( $tag, $tag_name );
}