WPCF7_ContactForm::find()public staticCF7 1.0

Retrieves contact form data that match given conditions.

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

Хуков нет.

Возвращает

Массив. Array of WPCF7_ContactForm objects.

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

$result = WPCF7_ContactForm::find( $args );
$args(строка|массив)
Arguments to be passed to WP_Query.
По умолчанию: ''

Код WPCF7_ContactForm::find() CF7 5.9.3

public static function find( $args = '' ) {
	$defaults = array(
		'post_status' => 'any',
		'posts_per_page' => -1,
		'offset' => 0,
		'orderby' => 'ID',
		'order' => 'ASC',
	);

	$args = wp_parse_args( $args, $defaults );

	$args['post_type'] = self::post_type;

	$q = new WP_Query();
	$posts = $q->query( $args );

	self::$found_items = $q->found_posts;

	$objs = array();

	foreach ( (array) $posts as $post ) {
		$objs[] = new self( $post );
	}

	return $objs;
}