WPCF7_HTMLFormatter::append_end_tagpublicCF7 1.0

Appends an end tag to the output property.

Метод класса: WPCF7_HTMLFormatter{}

Хуков нет.

Возвращает

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

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

$WPCF7_HTMLFormatter = new WPCF7_HTMLFormatter();
$WPCF7_HTMLFormatter->append_end_tag( $tag_name );
$tag_name(строка) (обязательный)
Tag name.

Код WPCF7_HTMLFormatter::append_end_tag() CF7 6.1.6

public function append_end_tag( $tag_name ) {
	if ( ! in_array( $tag_name, self::p_child_elements, true ) ) {
		// Remove unnecessary <br />.
		$this->output = preg_replace( '/\s*<br \/>\s*$/', '', $this->output );

		$this->output = wpcf7_strip_whitespaces( $this->output, 'end' ) . "\n";

		if ( $this->options['auto_indent'] ) {
			$this->append_preformatted(
				self::indent( count( $this->stacked_elements ) )
			);
		}
	}

	$this->append_preformatted(
		sprintf( '</%s>', $tag_name )
	);

	// Remove trailing <p></p>.
	$this->output = preg_replace( '/<p>\s*<\/p>$/', '', $this->output );
}