WPCF7_MailTag::__construct()publicCF7 1.0

The constructor method.

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

Хуков нет.

Возвращает

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

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

$WPCF7_MailTag = new WPCF7_MailTag();
$WPCF7_MailTag->__construct( $tag, $tagname, $values );
$tag (обязательный)
-
$tagname (обязательный)
-
$values (обязательный)
-

Код WPCF7_MailTag::__construct() CF7 6.0.1

public function __construct( $tag, $tagname, $values ) {
	$this->tag = $tag;
	$this->name = $this->tagname = $tagname;

	$this->options = array(
		'do_not_heat' => false,
		'format' => '',
	);

	if ( ! empty( $values ) ) {
		preg_match_all( '/"[^"]*"|\'[^\']*\'/', $values, $matches );
		$this->values = wpcf7_strip_quote_deep( $matches[0] );
	}

	if ( preg_match( '/^_raw_(.+)$/', $tagname, $matches ) ) {
		$this->name = trim( $matches[1] );
		$this->options['do_not_heat'] = true;
	}

	if ( preg_match( '/^_format_(.+)$/', $tagname, $matches ) ) {
		$this->name = trim( $matches[1] );
		$this->options['format'] = $this->values[0];
	}
}