Changeset 10512 for trunk/wp-includes/rss.php
- Timestamp:
- 02/05/2009 09:59:37 PM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-includes/rss.php
r10508 r10512 715 715 $cache_timestamp = 'rss_' . $this->file_name( $url ) . '_ts'; 716 716 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() ); 717 set_transient($cache_option, $rss); 718 set_transient($cache_timestamp, time() ); 725 719 726 720 return $cache_option; … … 737 731 $cache_option = 'rss_' . $this->file_name( $url ); 738 732 739 if ( ! get_option( $cache_option ) ) {733 if ( ! $rss = get_transient( $cache_option ) ) { 740 734 $this->debug( 741 735 "Cache doesn't contain: $url (cache option: $cache_option)" … … 743 737 return 0; 744 738 } 745 746 $rss = get_option( $cache_option );747 739 748 740 return $rss; … … 761 753 $cache_timestamp = 'rss_' . $this->file_name( $url ) . '_ts'; 762 754 763 if ( $mtime = get_ option($cache_timestamp) ) {755 if ( $mtime = get_transient($cache_timestamp) ) { 764 756 // find how long ago the file was added to the cache 765 757 // and whether that is longer then MAX_AGE
Note: See TracChangeset
for help on using the changeset viewer.