Changeset 54448 for trunk/src/wp-includes/cache-compat.php
- Timestamp:
- 10/10/2022 06:20:28 PM (3 years ago)
- File:
-
- 1 edited
-
trunk/src/wp-includes/cache-compat.php (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/cache-compat.php
r53767 r54448 139 139 */ 140 140 function wp_cache_flush_runtime() { 141 return wp_using_ext_object_cache() ? false : wp_cache_flush(); 141 if ( ! wp_cache_supports( 'flush_runtime' ) ) { 142 _doing_it_wrong( 143 __FUNCTION__, 144 __( 'Your object cache implementation does not support flushing the in-memory runtime cache.' ), 145 '6.1.0' 146 ); 147 148 return false; 149 } 150 151 return wp_cache_flush(); 142 152 } 143 153 endif; … … 148 158 * 149 159 * Before calling this function, always check for group flushing support using the 150 * `wp_cache_supports _group_flush()` function.160 * `wp_cache_supports( 'flush_group' )` function. 151 161 * 152 162 * @since 6.1.0 … … 161 171 global $wp_object_cache; 162 172 163 if ( ! wp_cache_supports _group_flush() ) {173 if ( ! wp_cache_supports( 'flush_group' ) ) { 164 174 _doing_it_wrong( 165 175 __FUNCTION__, … … 175 185 endif; 176 186 177 if ( ! function_exists( 'wp_cache_supports _group_flush' ) ) :178 /** 179 * Determines whether the object cache implementation supports flushing individual cache groups.187 if ( ! function_exists( 'wp_cache_supports' ) ) : 188 /** 189 * Determines whether the object cache implementation supports a particular feature. 180 190 * 181 191 * @since 6.1.0 182 192 * 183 * @see WP_Object_Cache::flush_group() 184 * 185 * @return bool True if group flushing is supported, false otherwise. 186 */ 187 function wp_cache_supports_group_flush() { 193 * @param string $feature Name of the feature to check for. Possible values include: 194 * 'add_multiple', 'set_multiple', 'get_multiple', 'delete_multiple', 195 * 'flush_runtime', 'flush_group'. 196 * @return bool True if the feature is supported, false otherwise. 197 */ 198 function wp_cache_supports( $feature ) { 188 199 return false; 189 200 }
Note: See TracChangeset
for help on using the changeset viewer.