[wp-trac] [WordPress Trac] #21330: Change pre_set_site_transient_* to affect $expiration
WordPress Trac
wp-trac at lists.automattic.com
Sun Jul 22 02:08:37 UTC 2012
#21330: Change pre_set_site_transient_* to affect $expiration
------------------------------------+------------------------------
Reporter: wpsmith | Owner:
Type: defect (bug) | Status: new
Priority: normal | Milestone: Awaiting Review
Component: Cache | Version:
Severity: normal | Resolution:
Keywords: has-patch dev-feedback |
------------------------------------+------------------------------
Comment (by wpsmith):
Replying to [comment:5 nacin]:
> I don't understand how [attachment:21330_opt2.patch] would work in a
plugin.
>
> Could you go a bit more into your use case, perhaps some sample code?
The expiration time is always set (right? if not set, it's set to 0 by the
time of the filter) and is always an integer. For example,
wp_check_browser_version() has a set expiration that is known.
So...assuming I knew the $key (93ce43dc55bd29ecc99e83ca12b5d7f4) in this
example.
`
add_filter(
'pre_set_site_transient_browser_93ce43dc55bd29ecc99e83ca12b5d7f4',
'wps_change_browser_transient' );
function wps_change_browser_transient( $val ) {
if ( is_int( $val ) && 604800 == $val )
$val = 1209600;
return $val;
}
`
However, I am not convinced that this is the best solution...
--
Ticket URL: <http://core.trac.wordpress.org/ticket/21330#comment:6>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software
More information about the wp-trac
mailing list