Make WordPress Core

Changeset 35431


Ignore:
Timestamp:
10/29/2015 11:51:21 AM (10 years ago)
Author:
SergeyBiryukov
Message:

Rename internal variable in set_transient().

The previous name was inadvertently changing the dynamic part of set_transient_{transient} action and the transient name passed to the action since [35082].

Props GregLone.
Fixes #34470.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/option.php

    r35170 r35431  
    713713    } else {
    714714        $transient_timeout = '_transient_timeout_' . $transient;
    715         $transient = '_transient_' . $transient;
    716         if ( false === get_option( $transient ) ) {
     715        $transient_option = '_transient_' . $transient;
     716        if ( false === get_option( $transient_option ) ) {
    717717            $autoload = 'yes';
    718718            if ( $expiration ) {
     
    720720                add_option( $transient_timeout, time() + $expiration, '', 'no' );
    721721            }
    722             $result = add_option( $transient, $value, '', $autoload );
     722            $result = add_option( $transient_option, $value, '', $autoload );
    723723        } else {
    724724            // If expiration is requested, but the transient has no timeout option,
     
    727727            if ( $expiration ) {
    728728                if ( false === get_option( $transient_timeout ) ) {
    729                     delete_option( $transient );
     729                    delete_option( $transient_option );
    730730                    add_option( $transient_timeout, time() + $expiration, '', 'no' );
    731                     $result = add_option( $transient, $value, '', 'no' );
     731                    $result = add_option( $transient_option, $value, '', 'no' );
    732732                    $update = false;
    733733                } else {
     
    736736            }
    737737            if ( $update ) {
    738                 $result = update_option( $transient, $value );
     738                $result = update_option( $transient_option, $value );
    739739            }
    740740        }
Note: See TracChangeset for help on using the changeset viewer.