WPCF7_FormTagsManager::scan
Scans form-tags in the text content.
Метод класса: WPCF7_FormTagsManager{}
Хуков нет.
Возвращает
Массив|Строку. An array of scanned form-tags if $replace is false. Otherwise text that scanned form-tags are replaced.
Использование
$WPCF7_FormTagsManager = new WPCF7_FormTagsManager(); $WPCF7_FormTagsManager->scan( $content, $replace );
- $content(строка) (обязательный)
- The text content including form-tags.
- $replace(true|false)
- Whether scanned form-tags will be replaced.
По умолчанию:false
Код WPCF7_FormTagsManager::scan() WPCF7 FormTagsManager::scan CF7 6.1.6
public function scan( $content, $replace = false ) {
$this->scanned_tags = array();
if ( empty( $this->tag_types ) ) {
if ( $replace ) {
return $content;
} else {
return $this->scanned_tags;
}
}
if ( $replace ) {
$content = preg_replace_callback(
'/' . $this->tag_regex() . '/su',
array( $this, 'replace_callback' ),
$content
);
return $content;
} else {
preg_replace_callback(
'/' . $this->tag_regex() . '/su',
array( $this, 'scan_callback' ),
$content
);
return $this->scanned_tags;
}
}