Make WordPress Core


Ignore:
Timestamp:
02/18/2022 12:04:52 PM (3 years ago)
Author:
spacedmonkey
Message:

Cache API: Add wp_cache_flush_runtime function

Add a new function called wp_cache_flush_runtime to existing caching functions found in WordPress. This function allows users to flush the runtime (in-memory) cache, without flushing the entire persistent cache.

Props: Spacedmonkey, tillkruess, flixos90, adamsilverstein, SergeyBiryukov, barryhughes.
Fixes: #55080.

File:
1 edited

Legend:

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

    r52708 r52772  
    270270
    271271/**
     272 * Removes all cache items from the in-memory runtime cache.
     273 *
     274 * @since 6.0.0
     275 *
     276 * @see WP_Object_Cache::flush()
     277 *
     278 * @return bool True on success, false on failure.
     279 */
     280function wp_cache_flush_runtime() {
     281    return wp_cache_flush();
     282}
     283
     284/**
    272285 * Closes the cache.
    273286 *
Note: See TracChangeset for help on using the changeset viewer.