WPCF7_HTMLFormatter::normalize_start_tag()public staticCF7 1.0

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() CF7 5.7.3

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 ) ) {
		// Normalize void element.
		$tag = preg_replace( '/\s*\/?>/', ' />', $tag );
	}

	return array( $tag, $tag_name );
}