WPCF7_HTMLFormatter::append_end_tag()publicCF7 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 5.9.5

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

		$this->output = rtrim( $this->output ) . "\n";

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

	$this->output .= sprintf( '</%s>', $tag_name );

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