Email::prepare_emails()
Description #
Get email ids of user. If email passed then add it to email property.
Source #
File: addons/free/email/class-email.php
public function prepare_emails() { global $wpdb; if ( empty( $this->args['users'] ) ) { return; } $user_ids = []; 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})" ); foreach ( $emails as $email ) { $this->add_email( $email ); } }
Expand full source code Collapse full source code View on GitHub: addons/free/email/class-email.php:274
Add your comment