WordPress.org

Make WordPress Core

Ticket #1499: functions.php.diff

File functions.php.diff, 674 bytes (added by westi, 16 years ago)

Patch to functions.php to improve add_option

  • wp-includes/functions.php

     
    319319
    320320// thx Alex Stapleton, http://alex.vort-x.net/blog/
    321321function add_option($name, $value = '', $description = '', $autoload = 'yes') {
    322         global $wpdb;
     322        global $wpdb, $cache_settings;
     323               
     324        //Get out quick if we have previously cached this.
     325        if (isset($cache_settings->$name))
     326                return;
     327       
    323328        $original = $value;
    324329        if ( is_array($value) || is_object($value) )
    325330                $value = serialize($value);
     
    18491854        }       
    18501855}
    18511856
    1852 ?>
    1853  No newline at end of file
     1857?>