Make WordPress Core

Changeset 13056


Ignore:
Timestamp:
02/11/2010 07:43:22 PM (17 years ago)
Author:
ryan
Message:

Don't query the timeout for core transients that do not have a timeout. Avoids useless queries on non-existent site options.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-includes/functions.php

    r13013 r13056  
    34643464                $value = wp_cache_get($transient, 'site-transient');
    34653465        } else {
     3466                // Core transients that do not have a timeout. Listed here so querying timeouts can be avoided.
     3467                $no_timeout = array('update_core', 'update_plugins', 'update_themes');
    34663468                $transient_option = '_site_transient_' . esc_sql($transient);
    3467                 $transient_timeout = '_site_transient_timeout_' . esc_sql($transient);
    3468                 $timeout = get_site_option($transient_timeout);
    3469                 if ( false !== $timeout && $timeout < time() ) {
    3470                         delete_site_option($transient_option);
    3471                         delete_site_option($transient_timeout);
    3472                         return false;
     3469                if ( !in_array($transient, $no_timeout) ) {
     3470                        $transient_timeout = '_site_transient_timeout_' . esc_sql($transient);
     3471                        $timeout = get_site_option($transient_timeout);
     3472                        if ( false !== $timeout && $timeout < time() ) {
     3473                                delete_site_option($transient_option);
     3474                                delete_site_option($transient_timeout);
     3475                                return false;
     3476                        }
    34733477                }
    34743478
Note: See TracChangeset for help on using the changeset viewer.