LLMS_Membership_Data::get_engagements( string $type, string $period = 'current' )
Retrieve # of engagements related to the membership awarded within the period.
Parameters Parameters
- $type
-
(string) (Required) Engagement type [email|certificate|achievement].
- $period
-
(string) (Optional) Date period [current|previous]. Default 'current'.
Default value: 'current'
Return Return
(int)
Source Source
File: includes/class.llms.membership.data.php
public function get_engagements( $type, $period = 'current' ) { global $wpdb; return $wpdb->get_var( $wpdb->prepare( " SELECT DISTINCT COUNT( user_id ) FROM {$wpdb->prefix}lifterlms_user_postmeta WHERE meta_key = %s AND post_id = %d AND updated_date BETWEEN %s AND %s ", '_' . $type, $this->post_id, $this->get_date( $period, 'start' ), $this->get_date( $period, 'end' ) ) ); }
Expand full source code Collapse full source code View on GitHub
Changelog Changelog
Version | Description |
---|---|
3.32.0 | Introduced. |