Helper::prepare_emails()
Description #
Get email ids of user. If email passed then add it to email property.
Source #
File: addons/email/class-helper.php
public function prepare_emails() { global $wpdb; if ( empty( $this->args['users'] ) ) { return; } $user_ids = array(); foreach ( $this->args['users'] as $k => $id ) { if ( is_email( $id ) ) { $this->add_email( $id ); } elseif ( is_numeric( $id ) ) { $user_ids[] = (int) $id; } } $ids_str = esc_sql( sanitize_comma_delimited( $user_ids ) ); if ( empty( $ids_str ) ) { return; } $emails = $wpdb->get_col( "SELECT user_email FROM {$wpdb->users} WHERE ID IN ({$ids_str})" ); // phpcs:ignore WordPress.DB foreach ( $emails as $email ) { $this->add_email( $email ); } }
Expand full source code Collapse full source code View on GitHub: addons/email/class-helper.php:275
Add your comment