wpcf7_output_form_tag_handler()CF7 1.0

The form-tag handler for the output type.

Хуков нет.

Возвращает

null. Ничего (null).

Использование

wpcf7_output_form_tag_handler( $tag );
$tag (обязательный)
-

Код wpcf7_output_form_tag_handler() CF7 5.9.3

function wpcf7_output_form_tag_handler( $tag ) {
	if ( empty( $tag->name ) ) {
		return '';
	}

	$value = (string) reset( $tag->values );

	if ( ! wpcf7_get_validation_error( $tag->name ) ) {
		$hangover = array_filter( (array) wpcf7_get_hangover( $tag->name ) );

		if ( $hangover ) {
			$value = (string) reset( $hangover );
		}
	}

	$html = sprintf(
		'<output %1$s>%2$s</output>',
		wpcf7_format_atts( array(
			'data-reflection-of' => $tag->name,
			'data-default' => $value,
			'name' => $tag->name,
			'class' => $tag->get_class_option(
				wpcf7_form_controls_class( $tag->type )
			),
			'id' => $tag->get_id_option(),
		) ),
		esc_html( $value )
	);

	return $html;
}