Make WordPress Core

Ticket #57743: 57743.patch

File 57743.patch, 2.5 KB (added by thakkarhardik, 4 years ago)
  • src/wp-includes/class-wp-object-cache.php

    diff --git a/src/wp-includes/class-wp-object-cache.php b/src/wp-includes/class-wp-object-cache.php
    index cd84b177539a1d834467c543726874b278642080..013a2f28f109323f1cd566271ddcbbaa12a78e5a 100644
    a b class WP_Object_Cache {  
    397397         * @param string $group Optional. Where the cache contents are grouped. Default 'default'.
    398398         * @param bool   $force Optional. Whether to force an update of the local cache
    399399         *                      from the persistent cache. Default false.
     400         * @param array  $found Optional. Whether array of keys were found in the cache (passed by reference).
     401         *                      Disambiguates a return of false, a storable value. Default empty array.
    400402         * @return array Array of return values, grouped by key. Each value is either
    401403         *               the cache contents on success, or false on failure.
    402404         */
    403         public function get_multiple( $keys, $group = 'default', $force = false ) {
     405        public function get_multiple( $keys, $group = 'default', $force = false, &$found = array() ) {
    404406                $values = array();
    405407
    406408                foreach ( $keys as $key ) {
    407                         $values[ $key ] = $this->get( $key, $group, $force );
     409                        $values[ $key ] = $this->get( $key, $group, $force, $found[ $key ] );
    408410                }
    409411
    410412                return $values;
  • src/wp-includes/cache.php

    diff --git a/src/wp-includes/cache.php b/src/wp-includes/cache.php
    index e7fe7b87a85cd42960f484d05aec1a3bad811279..9bb4f5dcf2c6b4f4da3a8588d5671b90693fb1b4 100644
    a b function wp_cache_get( $key, $group = '', $force = false, &$found = null ) {  
    166166 * @param string $group Optional. Where the cache contents are grouped. Default empty.
    167167 * @param bool   $force Optional. Whether to force an update of the local cache
    168168 *                      from the persistent cache. Default false.
     169 * @param array  $found Optional. Whether array of keys were found in the cache (passed by reference).
     170*                       Disambiguates a return of false, a storable value. Default empty array.
    169171 * @return array Array of return values, grouped by key. Each value is either
    170172 *               the cache contents on success, or false on failure.
    171173 */
    172 function wp_cache_get_multiple( $keys, $group = '', $force = false ) {
     174function wp_cache_get_multiple( $keys, $group = '', $force = false, &$found = array() ) {
    173175        global $wp_object_cache;
    174176
    175         return $wp_object_cache->get_multiple( $keys, $group, $force );
     177        return $wp_object_cache->get_multiple( $keys, $group, $force, $found );
    176178}
    177179
    178180/**