Gocodebox_Banner_Notifier::notification_test_llms_num_orders( bool $value, array $data )

LifterLMS number of orders test.


Parameters Parameters

$value

(bool) (Required) The current test value.

$data

(array) (Required) Array from the notification with [0] comparison operator and [1] number of orders.


Top ↑

Source Source

File: libraries/banner-notifications/src/notifications.php

	function notification_test_llms_num_orders( $value, $data ) {
		global $wpdb;
		static $num_orders;

		if ( ! is_array( $data ) || ! isset( $data[0] ) || ! isset( $data[1] ) ) {
			return false;
		}

		if ( ! isset( $num_orders ) ) {
			$sql_query  = "SELECT COUNT(*)
							FROM {$wpdb->posts} AS orders
							WHERE post_status IN ('llms-active', 'llms-completed', 'llms-on-hold', 'llms-pending=cancel', 'llms-cancelled', 'llms-expired')
							  AND post_type = 'llms_order'";
			$num_orders = $wpdb->get_var( $sql_query );
		}

		return $this->int_compare( $num_orders, $data[1], $data[0] );
	}


Top ↑

User Contributed Notes User Contributed Notes

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