Make WordPress Core

Ticket #24685: 24685.diff

File 24685.diff, 1.4 KB (added by wonderboymusic, 12 years ago)
  • wp-includes/option.php

    diff --git wp-includes/option.php wp-includes/option.php
    index 3df89c2..b983876 100644
    function get_transient( $transient ) { 
    456456                if ( ! defined( 'WP_INSTALLING' ) ) {
    457457                        // If option is not in alloptions, it is not autoloaded and thus has a timeout
    458458                        $alloptions = wp_load_alloptions();
    459                         if ( !isset( $alloptions[$transient_option] ) ) {
     459                        if ( ! isset( $alloptions[$transient_option] ) ) {
    460460                                $transient_timeout = '_transient_timeout_' . $transient;
    461461                                if ( get_option( $transient_timeout ) < time() ) {
    462462                                        delete_option( $transient_option  );
    463463                                        delete_option( $transient_timeout );
    464                                         return false;
     464                                        $value = false;
    465465                                }
    466466                        }
    467467                }
    468468
    469                 $value = get_option( $transient_option );
     469                if ( ! isset( $value ) )
     470                        $value = get_option( $transient_option );
    470471        }
    471472
    472473        return apply_filters( 'transient_' . $transient, $value );
    function get_site_transient( $transient ) { 
    10011002                        if ( false !== $timeout && $timeout < time() ) {
    10021003                                delete_site_option( $transient_option  );
    10031004                                delete_site_option( $transient_timeout );
    1004                                 return false;
     1005                                $value = false;
    10051006                        }
    10061007                }
    10071008
    1008                 $value = get_site_option( $transient_option );
     1009                if ( ! isset( $value ) )
     1010                        $value = get_site_option( $transient_option );
    10091011        }
    10101012
    10111013        return apply_filters( 'site_transient_' . $transient, $value );