Make WordPress Core


Ignore:
Timestamp:
05/02/2023 11:24:52 AM (13 months ago)
Author:
spacedmonkey
Message:

Cache API: Add helper function wp_cache_set_last_changed.

Add a helper function called wp_cache_set_last_changed to set the last changed value for cache groups. This function has a new action called wp_cache_set_last_changed, allowing for developers to cache invalidate when last changed value is changed.

Props tillkruess, spacedmonkey, peterwilsoncc, mukesh27, johnjamesjacoby.
Fixes #57905.

File:
1 edited

Legend:

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

    r55526 r55702  
    12821282 */
    12831283function wp_cache_set_sites_last_changed() {
    1284     wp_cache_set( 'last_changed', microtime(), 'sites' );
     1284    wp_cache_set_last_changed( 'sites' );
    12851285}
    12861286
Note: See TracChangeset for help on using the changeset viewer.