WordPress at Your Fingertips
function is not described

WC_API_Coupons::query_coupons() private WC 2.1

Helper method to get coupon post objects

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

No Hooks.

Return

WP_Query.

Usage

// private - for code of main (parent) class only
$result = $this->query_coupons( $args );
$args(array) (required)
request arguments for filtering query

Changelog

Since 2.1 Introduced.

Code of WC_API_Coupons::query_coupons() WC 5.7.1

private function query_coupons( $args ) {

	// set base query arguments
	$query_args = array(
		'fields'      => 'ids',
		'post_type'   => 'shop_coupon',
		'post_status' => 'publish',
	);

	$query_args = $this->merge_query_args( $query_args, $args );

	return new WP_Query( $query_args );
}