Changeset 52706 for trunk/src/wp-includes/cache-compat.php
- Timestamp:
- 02/11/2022 06:47:38 PM (3 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/cache-compat.php
r52703 r52706 8 8 * @subpackage Cache 9 9 */ 10 11 if ( ! function_exists( 'wp_cache_get_multiple' ) ) :12 /**13 * Retrieves multiple values from the cache in one call.14 *15 * Compat function to mimic wp_cache_get_multiple().16 *17 * @ignore18 * @since 5.5.019 *20 * @see wp_cache_get_multiple()21 *22 * @param array $keys Array of keys under which the cache contents are stored.23 * @param string $group Optional. Where the cache contents are grouped. Default empty.24 * @param bool $force Optional. Whether to force an update of the local cache25 * from the persistent cache. Default false.26 * @return array Array of values organized into groups.27 */28 function wp_cache_get_multiple( $keys, $group = '', $force = false ) {29 $values = array();30 31 foreach ( $keys as $key ) {32 $values[ $key ] = wp_cache_get( $key, $group, $force );33 }34 35 return $values;36 }37 endif;38 39 if ( ! function_exists( 'wp_cache_delete_multiple' ) ) :40 /**41 * Deletes multiple values from the cache in one call.42 *43 * Compat function to mimic wp_cache_delete_multiple().44 *45 * @ignore46 * @since 6.0.047 *48 * @see wp_cache_delete_multiple()49 *50 * @param array $keys Array of keys under which the cache to deleted.51 * @param string $group Optional. Where the cache contents are grouped. Default empty.52 * @return array Array of return values.53 */54 function wp_cache_delete_multiple( array $keys, $group = '' ) {55 $values = array();56 57 foreach ( $keys as $key ) {58 $values[ $key ] = wp_cache_delete( $key, $group );59 }60 61 return $values;62 }63 endif;64 65 10 66 11 if ( ! function_exists( 'wp_cache_add_multiple' ) ) : … … 121 66 } 122 67 endif; 68 69 if ( ! function_exists( 'wp_cache_get_multiple' ) ) : 70 /** 71 * Retrieves multiple values from the cache in one call. 72 * 73 * Compat function to mimic wp_cache_get_multiple(). 74 * 75 * @ignore 76 * @since 5.5.0 77 * 78 * @see wp_cache_get_multiple() 79 * 80 * @param array $keys Array of keys under which the cache contents are stored. 81 * @param string $group Optional. Where the cache contents are grouped. Default empty. 82 * @param bool $force Optional. Whether to force an update of the local cache 83 * from the persistent cache. Default false. 84 * @return array Array of values organized into groups. 85 */ 86 function wp_cache_get_multiple( $keys, $group = '', $force = false ) { 87 $values = array(); 88 89 foreach ( $keys as $key ) { 90 $values[ $key ] = wp_cache_get( $key, $group, $force ); 91 } 92 93 return $values; 94 } 95 endif; 96 97 if ( ! function_exists( 'wp_cache_delete_multiple' ) ) : 98 /** 99 * Deletes multiple values from the cache in one call. 100 * 101 * Compat function to mimic wp_cache_delete_multiple(). 102 * 103 * @ignore 104 * @since 6.0.0 105 * 106 * @see wp_cache_delete_multiple() 107 * 108 * @param array $keys Array of keys under which the cache to deleted. 109 * @param string $group Optional. Where the cache contents are grouped. Default empty. 110 * @return array Array of return values. 111 */ 112 function wp_cache_delete_multiple( array $keys, $group = '' ) { 113 $values = array(); 114 115 foreach ( $keys as $key ) { 116 $values[ $key ] = wp_cache_delete( $key, $group ); 117 } 118 119 return $values; 120 } 121 endif;
Note: See TracChangeset
for help on using the changeset viewer.