WC_Query::get_current_posts()protectedWC 1.0

Get the posts (or the ids of the posts) found in the current WP loop.

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

Хуков нет.

Возвращает

Массив. Array of posts or post ids.

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

// protected - в коде основоного (родительского) или дочернего класса
$result = $this->get_current_posts();

Код WC_Query::get_current_posts() WC 8.7.0

protected function get_current_posts() {
	return $GLOBALS['wp_query']->posts;
}