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.
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] );
}
Expand full source code Collapse full source code View on GitHub