[wp-trac] [WordPress Trac] #37464: Last changed helper function
WordPress Trac
noreply at wordpress.org
Fri Oct 21 02:53:21 UTC 2016
#37464: Last changed helper function
----------------------------------------+--------------------------
Reporter: spacedmonkey | Owner: jorbin
Type: enhancement | Status: closed
Priority: normal | Milestone: 4.7
Component: Cache API | Version:
Severity: normal | Resolution: fixed
Keywords: has-patch needs-unit-tests | Focuses: performance
----------------------------------------+--------------------------
Changes (by jorbin):
* status: assigned => closed
* resolution: => fixed
Comment:
In [changeset:"38849"]:
{{{
#!CommitTicketReference repository="" revision="38849"
Cache API: introduce wp_cache_get_last_changed to improve DRY
One thing fairly common to the cache groups is a block of code to look to
see when the cache was last changed, and if there isn't one, to set it for
the current microtime(). It appears in 8 different places in core. This
adds a new helper `wp_cache_get_last_changed` to DRY things up a bit.
Since `wp-includes/cache.php` isn't guaranteed to be loaded, this new
function is in `wp-includes/functions.php`
Props spacedmonkey, desrosj.
Fixes #37464.
}}}
--
Ticket URL: <https://core.trac.wordpress.org/ticket/37464#comment:16>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list