Changeset 55702 for trunk/src/wp-includes/functions.php
- Timestamp:
- 05/02/2023 11:24:52 AM (20 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/functions.php
r55642 r55702 7681 7681 $last_changed = wp_cache_get( 'last_changed', $group ); 7682 7682 7683 if ( ! $last_changed ) { 7684 $last_changed = microtime(); 7685 wp_cache_set( 'last_changed', $last_changed, $group ); 7686 } 7687 7688 return $last_changed; 7683 if ( $last_changed ) { 7684 return $last_changed; 7685 } 7686 7687 return wp_cache_set_last_changed( $group ); 7688 } 7689 7690 /** 7691 * Sets last changed date for the specified cache group to now. 7692 * 7693 * @since 6.3.0 7694 * 7695 * @param string $group Where the cache contents are grouped. 7696 * @return string UNIX timestamp when the group was last changed. 7697 */ 7698 function wp_cache_set_last_changed( $group ) { 7699 $previous_time = wp_cache_get( 'last_changed', $group ); 7700 7701 $time = microtime(); 7702 7703 wp_cache_set( 'last_changed', $time, $group ); 7704 7705 /** 7706 * Fires after a cache group `last_changed` time is updated. 7707 * This may occur multiple times per page load and registered 7708 * actions must be performant. 7709 * 7710 * @since 6.3.0 7711 * 7712 * @param string $group The cache group name. 7713 * @param int $time The new last changed time. 7714 * @param int|false $previous_time The previous last changed time. False if not previously set. 7715 */ 7716 do_action( 'wp_cache_set_last_changed', $group, $time, $previous_time ); 7717 7718 return $time; 7689 7719 } 7690 7720
Note: See TracChangeset
for help on using the changeset viewer.