Make WordPress Core


Ignore:
Timestamp:
02/05/2009 08:47:30 PM (18 years ago)
Author:
ryan
Message:

Revert 10507. Had extra bits in. see #8702

File:
1 edited

Legend:

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

    r10507 r10508  
    715715                $cache_timestamp = 'rss_' . $this->file_name( $url ) . '_ts';
    716716
    717                 set_transient($cache_option, $rss);
    718                 set_transient($cache_timestamp, time() );
     717                // shouldn't these be using get_option() ?
     718                if ( !$wpdb->get_var( $wpdb->prepare( "SELECT option_name FROM $wpdb->options WHERE option_name = %s", $cache_option ) ) )
     719                        add_option($cache_option, '', '', 'no');
     720                if ( !$wpdb->get_var( $wpdb->prepare( "SELECT option_name FROM $wpdb->options WHERE option_name = %s", $cache_timestamp ) ) )
     721                        add_option($cache_timestamp, '', '', 'no');
     722
     723                update_option($cache_option, $rss);
     724                update_option($cache_timestamp, time() );
    719725
    720726                return $cache_option;
     
    731737                $cache_option = 'rss_' . $this->file_name( $url );
    732738
    733                 if ( ! $rss = get_transient( $cache_option ) ) {
     739                if ( ! get_option( $cache_option ) ) {
    734740                        $this->debug(
    735741                                "Cache doesn't contain: $url (cache option: $cache_option)"
     
    737743                        return 0;
    738744                }
     745
     746                $rss = get_option( $cache_option );
    739747
    740748                return $rss;
     
    753761                $cache_timestamp = 'rss_' . $this->file_name( $url ) . '_ts';
    754762
    755                 if ( $mtime = get_transient($cache_timestamp) ) {
     763                if ( $mtime = get_option($cache_timestamp) ) {
    756764                        // find how long ago the file was added to the cache
    757765                        // and whether that is longer then MAX_AGE
Note: See TracChangeset for help on using the changeset viewer.