WPCF7_FormTagsManager::normalize_callback()privateCF7 1.0

The callback function used within normalize().

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

Хуков нет.

Возвращает

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

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

// private - только в коде основоного (родительского) класса
$result = $this->normalize_callback( $matches );
$matches (обязательный)
-

Код WPCF7_FormTagsManager::normalize_callback() CF7 5.9.3

private function normalize_callback( $matches ) {
	// allow [[foo]] syntax for escaping a tag
	if ( $matches[1] == '['
	and $matches[6] == ']' ) {
		return $matches[0];
	}

	$tag = $matches[2];

	$attr = trim( preg_replace( '/[\r\n\t ]+/', ' ', $matches[3] ) );
	$attr = strtr( $attr, array( '<' => '&lt;', '>' => '&gt;' ) );

	$content = trim( $matches[5] );
	$content = str_replace( "\n", '<WPPreserveNewline />', $content );

	$result = $matches[1] . '[' . $tag
		. ( $attr ? ' ' . $attr : '' )
		. ( $matches[4] ? ' ' . $matches[4] : '' )
		. ']'
		. ( $content ? $content . '[/' . $tag . ']' : '' )
		. $matches[6];

	return $result;
}