Alert: This function’s access is marked private. This means it is not intended for use by plugin or theme developers, only in other core functions. It is listed here for completeness.

LLMS_Course_Data::orders_query( int $num_orders = 1, array $dates = array() )

Execute a WP Query to retrieve orders within the given date range


Parameters Parameters

$num_orders

(int) (Optional) Number of orders to retrieve. Default is 1.

Default value: 1

$dates

(array) (Optional) Date range (passed to WP_Query['date_query']). Default is empty array.

Default value: array()


Top ↑

Return Return

(WP_Query)


Top ↑

Source Source

File: includes/class.llms.course.data.php

	private function orders_query( $num_orders = 1, $dates = array() ) {

		$args = array(
			'post_type'      => 'llms_order',
			'post_status'    => array( 'llms-active', 'llms-completed' ),
			'posts_per_page' => $num_orders,
			'meta_key'       => '_llms_product_id',
			'meta_value'     => $this->post_id,
		);

		if ( ! empty( $dates ) ) {
			$args['date_query'] = $dates;
		}

		return new WP_Query( $args );

	}


Top ↑

Changelog Changelog

Changelog
Version Description
4.21.0 Fixed the post status for completed orders.
3.15.0 Introduced.

Top ↑

User Contributed Notes User Contributed Notes

You must log in before being able to contribute a note or feedback.