Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public function batch_init() {
- global $wpdb;
- $members = array();
- $query = "
- SELECT u.ID FROM $wpdb->users u
- LEFT JOIN $wpdb->pmpro_memberships_users mu ON u.ID = mu.user_id
- LEFT JOIN $wpdb->pmpro_membership_levels m ON mu.membership_id = m.id
- WHERE mu.membership_id > 0
- GROUP BY u.ID
- ORDER BY u.user_registered ASC
- ";
- $result = $wpdb->get_results( $query, ARRAY_A );
- if ( ! empty( $result ) ) {
- foreach ( $result as $member ) {
- $members[] = $member['ID'];
- }
- }
- return $members;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement