cache_users() – Retrieves info for user lists to prevent multiple queries by get_userdata().

You appear to be a bot. Output may be restricted

Description

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

Usage

cache_users( $user_ids );

Parameters

$user_ids
( int[] ) required – User ID numbers list

Returns

void

Source

File name: wordpress/wp-includes/pluggable.php


Lines:

1 to 20 of 20
  function cache_users( $user_ids ) {
    global $wpdb;

    update_meta_cache( 'user', $user_ids );

    $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)" );

    foreach ( $users as $user ) {
      update_user_caches( $user );
    }
  }
 

 View on GitHub View on Trac