[wp-trac] [WordPress Trac] #21330: Allow filtering of expiration in set_transient()

WordPress Trac noreply at wordpress.org
Tue Mar 4 18:25:09 UTC 2014


#21330: Allow filtering of expiration in set_transient()
-------------------------+------------------
 Reporter:  wpsmith      |       Owner:
     Type:  enhancement  |      Status:  new
 Priority:  normal       |   Milestone:  3.9
Component:  Cache API    |     Version:
 Severity:  normal       |  Resolution:
 Keywords:  has-patch    |     Focuses:
-------------------------+------------------

Comment (by nacin):

 As evidenced by IRC, naming this filter is a pain.

 But also:

 {{{
 #!php
 <?php
 add_action( 'set_transient_my_transient', function( $value, $expiration )
 {
     $desired_expiration = 600;
     if ( $expiration != $desired_expiration ) {
         set_transient( 'my_transient', $value, $desired_expiration );
     }
 });
 }}}

--
Ticket URL: <https://core.trac.wordpress.org/ticket/21330#comment:15>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list