WordPress.org

Make WordPress Core

Ticket #22174: 22174.diff

File 22174.diff, 844 bytes (added by wonderboymusic, 7 years ago)
  • wp-includes/functions.php

    diff --git wp-includes/functions.php wp-includes/functions.php
    index 8200695..5940502 100644
    function wp_debug_backtrace_summary( $ignore_class = null, $skip_frames = 0, $pr 
    38593859 */
    38603860function _get_non_cached_ids( $object_ids, $cache_key ) {
    38613861        $clean = array();
    3862         foreach ( $object_ids as $id ) {
    3863                 $id = (int) $id;
    3864                 if ( !wp_cache_get( $id, $cache_key ) ) {
    3865                         $clean[] = $id;
     3862        if ( function_exists( 'wp_cache_get_multi' ) ) {
     3863                $posts = wp_cache_get_multi( $object_ids, $cache_key );
     3864                $found_ids = wp_list_pluck( $posts, 'ID' );
     3865                $clean = array_diff( $object_ids, $found_ids );
     3866        } else {
     3867                foreach ( $object_ids as $id ) {
     3868                        $id = (int) $id;
     3869                        if ( !wp_cache_get( $id, $cache_key ) ) {
     3870                                $clean[] = $id;
     3871                        }
    38663872                }
    38673873        }
    3868 
    38693874        return $clean;
    38703875}
    38713876