WordPress at Your Fingertips
function is not described

WC_Query::get_current_posts() protected WC 1.0

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

{} It's a method of the class: WC_Query{}

No Hooks.


Array. Array of posts or post ids.


// protected - for code of main (parent) or child class
$result = $this->get_current_posts();

Code of WC_Query::get_current_posts() WC 5.7.1

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