Make WordPress Core

Ticket #6694: 6694.diff

File 6694.diff, 1.0 KB (added by mdawaffe, 18 years ago)

don't cache during title extraction

  • wp-includes/widgets.php

     
    858858}
    859859
    860860function wp_widget_recent_entries($args) {
    861         if ( $output = wp_cache_get('widget_recent_entries', 'widget') )
    862                 return print($output);
     861        if ( '%BEG_OF_TITLE%' != $args['before_title'] ) {
     862                if ( $output = wp_cache_get('widget_recent_entries', 'widget') )
     863                        return print($output);
     864                ob_start();
     865        }
    863866
    864         ob_start();
    865867        extract($args);
    866868        $options = get_option('widget_recent_entries');
    867869        $title = empty($options['title']) ? __('Recent Posts') : $options['title'];
     
    886888<?php
    887889                wp_reset_query();  // Restore global post data stomped by the_post().
    888890        endif;
    889         wp_cache_add('widget_recent_entries', ob_get_flush(), 'widget');
     891
     892        if ( '%BEG_OF_TITLE%' != $args['before_title'] )
     893                wp_cache_add('widget_recent_entries', ob_get_flush(), 'widget');
    890894}
    891895
    892896function wp_flush_widget_recent_entries() {