WPCF7_FormTagsManager::normalize_callback
The callback function used within normalize().
Метод класса: WPCF7_FormTagsManager{}
Хуков нет.
Возвращает
null. Ничего (null).
Использование
// private - только в коде основоного (родительского) класса $result = $this->normalize_callback( $matches );
- $matches(обязательный)
- .
Код WPCF7_FormTagsManager::normalize_callback() WPCF7 FormTagsManager::normalize callback CF7 6.1.5
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( '<' => '<', '>' => '>' ) );
$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;
}