Changeset 27966 for trunk/src/wp-includes/default-widgets.php
- Timestamp:
- 04/06/2014 06:47:46 PM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/default-widgets.php
r27697 r27966 661 661 662 662 function widget($args, $instance) { 663 $cache = wp_cache_get('widget_recent_posts', 'widget'); 664 665 if ( !is_array($cache) ) 663 $cache = array(); 664 if ( ! $this->is_preview() ) { 665 $cache = wp_cache_get( 'widget_recent_posts', 'widget' ); 666 } 667 668 if ( ! is_array( $cache ) ) { 666 669 $cache = array(); 667 668 if ( ! isset( $args['widget_id'] ) ) 670 } 671 672 if ( ! isset( $args['widget_id'] ) ) { 669 673 $args['widget_id'] = $this->id; 674 } 670 675 671 676 if ( isset( $cache[ $args['widget_id'] ] ) ) { … … 724 729 endif; 725 730 726 $cache[$args['widget_id']] = ob_get_flush(); 727 wp_cache_set('widget_recent_posts', $cache, 'widget'); 731 if ( ! $this->is_preview() ) { 732 $cache[ $args['widget_id'] ] = ob_get_flush(); 733 wp_cache_set( 'widget_recent_posts', $cache, 'widget' ); 734 } else { 735 ob_flush(); 736 } 728 737 } 729 738 … … 808 817 global $comments, $comment; 809 818 810 $cache = wp_cache_get('widget_recent_comments', 'widget'); 811 812 if ( ! is_array( $cache ) ) 819 $cache = array(); 820 if ( ! $this->is_preview() ) { 821 $cache = wp_cache_get('widget_recent_comments', 'widget'); 822 } 823 if ( ! is_array( $cache ) ) { 813 824 $cache = array(); 825 } 814 826 815 827 if ( ! isset( $args['widget_id'] ) ) … … 866 878 867 879 echo $output; 868 $cache[$args['widget_id']] = $output; 869 wp_cache_set('widget_recent_comments', $cache, 'widget'); 880 881 if ( ! $this->is_preview() ) { 882 $cache[ $args['widget_id'] ] = $output; 883 wp_cache_set( 'widget_recent_comments', $cache, 'widget' ); 884 } 870 885 } 871 886
Note: See TracChangeset
for help on using the changeset viewer.