WordPress как на ладони
Недорогой хостинг для сайтов на WordPress: wordpress.jino.ru Авторские Темы для WordPress
функция не описана

WPCF7_FormTagsManager::filter() public CF7 1.0

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

Хуков нет.

Возвращает

null. Ничего.

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

$WPCF7_FormTagsManager = new WPCF7_FormTagsManager();
$WPCF7_FormTagsManager->filter( $input, $cond );
$input (обязательный)
-
$cond (обязательный)
-

Код WPCF7_FormTagsManager::filter() CF7 5.4.1

<?php
public function filter( $input, $cond ) {
	if ( is_array( $input ) ) {
		$tags = $input;
	} elseif ( is_string( $input ) ) {
		$tags = $this->scan( $input );
	} else {
		$tags = $this->scanned_tags;
	}

	if ( empty( $tags ) ) {
		return array();
	}

	$cond = wp_parse_args( $cond, array(
		'type' => array(),
		'name' => array(),
		'feature' => '',
	) );

	$type = array_filter( (array) $cond['type'] );
	$name = array_filter( (array) $cond['name'] );
	$feature = is_string( $cond['feature'] ) ? trim( $cond['feature'] ) : '';

	if ( '!' == substr( $feature, 0, 1 ) ) {
		$feature_negative = true;
		$feature = trim( substr( $feature, 1 ) );
	} else {
		$feature_negative = false;
	}

	$output = array();

	foreach ( $tags as $tag ) {
		$tag = new WPCF7_FormTag( $tag );

		if ( $type and ! in_array( $tag->type, $type, true ) ) {
			continue;
		}

		if ( $name and ! in_array( $tag->name, $name, true ) ) {
			continue;
		}

		if ( $feature ) {
			if ( ! $this->tag_type_supports( $tag->type, $feature )
			and ! $feature_negative ) {
				continue;
			} elseif ( $this->tag_type_supports( $tag->type, $feature )
			and $feature_negative ) {
				continue;
			}
		}

		$output[] = $tag;
	}

	return $output;
}