Make WordPress Core


Ignore:
Timestamp:
02/11/2022 06:50:08 PM (3 years ago)
Author:
spacedmonkey
Message:

Cache: Use wp_cache_*_multiple() in core functions.

Implement the wp_cache_add_multiplewp_cache_set_multiple and wp_cache_delete_multiple in a number of core functions after they were introduced in [52700]

Props: spacedmonkey, adamsilverstein, flixos90, mitogh.
Fixes: #55029.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/post.php

    r52691 r52707  
    73697369    }
    73707370
     7371    $data = array();
    73717372    foreach ( $posts as $post ) {
    7372         wp_cache_add( $post->ID, $post, 'posts' );
    7373     }
     7373        $data[ $post->ID ] = $post;
     7374    }
     7375    wp_cache_add_multiple( $data, 'posts' );
    73747376}
    73757377
Note: See TracChangeset for help on using the changeset viewer.