Eine auf WordPress spezialiserte Suchmaschine für Entwickler und Theme-Autoren



cache_users ›

Seit3.0.0
Veraltetn/v
cache_users ( $user_ids )
Parameter:
  • (array) $user_ids User ID numbers list
    Erforderlich: Ja
Definiert in:
Codex:

Retrieve info for user lists to prevent multiple queries by get_userdata()



Quellcode

function cache_users( $user_ids ) {
		global $wpdb;

		$clean = _get_non_cached_ids( $user_ids, 'users' );

		if ( empty( $clean ) ) {
			return;
		}

		$list = implode( ',', $clean );

		$users = $wpdb->get_results( "SELECT * FROM $wpdb->users WHERE ID IN ($list)" );

		$ids = array();
		foreach ( $users as $user ) {
			update_user_caches( $user );
			$ids[] = $user->ID;
		}
		update_meta_cache( 'user', $ids );
	}
endif;

if ( ! function_exists( 'wp_mail' ) ) :
	/**
	 * Sends an email, similar to PHP's mail function.
	 *
	 * A true return value does not automatically mean that the user received the
	 * email successfully. It just only means that the method used was able to
	 * process the request without any errors.
	 *
	 * The default content type is `text/plain` which does not allow using HTML.
	 * However, you can set the content type of the email by using the
	 * {@see 'wp_mail_content_type'} filter.
	 *
	 * The default charset is based on the charset used on the blog. The charset can
	 * be set using the {@see 'wp_mail_charset'} filter.
	 *
	 * @since 1.2.1
	 *
	 * @global PHPMailer\PHPMailer\PHPMailer $phpmailer
	 *
	 * @param string|array $to          Array or comma-separated list of email addresses to send message.
	 * @param string       $subject     Email subject
	 * @param string       $message     Message contents
	 * @param string|array $headers     Optional. Additional headers.
	 * @param string|array $attachments Optional. Files to attach.
	 * @return bool Whether the email contents were sent successfully.
	 */