[wp-trac] [WordPress Trac] #22369: get_transient() do not call delete_transient() when deleting one

WordPress Trac noreply at wordpress.org
Mon Mar 18 09:11:56 UTC 2024


#22369: get_transient() do not call delete_transient() when deleting one
--------------------------+-----------------------
 Reporter:  juliobox      |       Owner:  (none)
     Type:  defect (bug)  |      Status:  reopened
 Priority:  normal        |   Milestone:
Component:  General       |     Version:  2.8
 Severity:  normal        |  Resolution:
 Keywords:  close         |     Focuses:
--------------------------+-----------------------
Changes (by juliobox):

 * status:  closed => reopened
 * resolution:  invalid =>


Comment:

 Hey there, i'm back.
 So if it has expired, why not trigger an action hook?

 {{{
                                 $transient_option = '_transient_' .
 $transient;
                                 $transient_timeout = '_transient_timeout_'
 . $transient;
                                 if ( get_option( $transient_timeout ) <
 time() ) {
                                         delete_option( $transient_option
 );
                                         delete_option( $transient_timeout
 );
                                         do_action( 'transient_expired',
 $transient, $timeout );
                                         return false;
                                 }
 }}}
 Thanks

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


More information about the wp-trac mailing list