WordPress.org

Make WordPress Core

Ticket #21330: 21330.diff

File 21330.diff, 1.2 KB (added by nacin, 20 months ago)
  • wp-includes/option.php

     
    491491function set_transient( $transient, $value, $expiration = 0 ) { 
    492492        global $_wp_using_ext_object_cache; 
    493493 
    494         $value = apply_filters( 'pre_set_transient_' . $transient, $value ); 
     494        $value = apply_filters( 'pre_set_transient_' . $transient, $value, $expiration ); 
     495        $expiration = apply_filters( 'expiration_pre_set_transient_' . $transient, $expiration, $value ); 
    495496 
    496497        if ( $_wp_using_ext_object_cache ) { 
    497498                $result = wp_cache_set( $transient, $value, 'transient', $expiration ); 
     
    10211022function set_site_transient( $transient, $value, $expiration = 0 ) { 
    10221023        global $_wp_using_ext_object_cache; 
    10231024 
    1024         $value = apply_filters( 'pre_set_site_transient_' . $transient, $value ); 
     1025        $value = apply_filters( 'pre_set_site_transient_' . $transient, $value, $expiration ); 
     1026        $expiration = apply_filters( 'expiration_pre_set_site_transient_' . $transient, $expiration, $value ); 
    10251027 
    10261028        if ( $_wp_using_ext_object_cache ) { 
    10271029                $result = wp_cache_set( $transient, $value, 'site-transient', $expiration );