diff --git src/wp-includes/default-widgets.php src/wp-includes/default-widgets.php
index 68048c3..aeafa92 100644
|
|
|
class WP_Widget_Recent_Posts extends WP_Widget { |
| 660 | 660 | } |
| 661 | 661 | |
| 662 | 662 | function widget($args, $instance) { |
| 663 | | $cache = wp_cache_get('widget_recent_posts', 'widget'); |
| | 663 | global $wp_customize; |
| | 664 | $is_customize_preview = ( isset( $wp_customize ) && $wp_customize->is_preview() ) ; |
| 664 | 665 | |
| 665 | | if ( !is_array($cache) ) |
| | 666 | $cache = array(); |
| | 667 | if ( ! $is_customize_preview ) { |
| | 668 | $cache = wp_cache_get( 'widget_recent_posts', 'widget' ); |
| | 669 | } |
| | 670 | |
| | 671 | if ( ! is_array( $cache ) ) { |
| 666 | 672 | $cache = array(); |
| | 673 | } |
| 667 | 674 | |
| 668 | | if ( ! isset( $args['widget_id'] ) ) |
| | 675 | if ( ! isset( $args['widget_id'] ) ) { |
| 669 | 676 | $args['widget_id'] = $this->id; |
| | 677 | } |
| 670 | 678 | |
| 671 | 679 | if ( isset( $cache[ $args['widget_id'] ] ) ) { |
| 672 | 680 | echo $cache[ $args['widget_id'] ]; |
| … |
… |
class WP_Widget_Recent_Posts extends WP_Widget { |
| 723 | 731 | |
| 724 | 732 | endif; |
| 725 | 733 | |
| 726 | | $cache[$args['widget_id']] = ob_get_flush(); |
| 727 | | wp_cache_set('widget_recent_posts', $cache, 'widget'); |
| | 734 | if ( ! $is_customize_preview ) { |
| | 735 | $cache[ $args['widget_id'] ] = ob_get_flush(); |
| | 736 | wp_cache_set( 'widget_recent_posts', $cache, 'widget' ); |
| | 737 | } else { |
| | 738 | ob_flush(); |
| | 739 | } |
| 728 | 740 | } |
| 729 | 741 | |
| 730 | 742 | function update( $new_instance, $old_instance ) { |
| … |
… |
class WP_Widget_Recent_Comments extends WP_Widget { |
| 805 | 817 | } |
| 806 | 818 | |
| 807 | 819 | function widget( $args, $instance ) { |
| 808 | | global $comments, $comment; |
| 809 | | |
| 810 | | $cache = wp_cache_get('widget_recent_comments', 'widget'); |
| | 820 | global $comments, $comment, $wp_customize; |
| | 821 | $is_customize_preview = ( isset( $wp_customize ) && $wp_customize->is_preview() ); |
| 811 | 822 | |
| 812 | | if ( ! is_array( $cache ) ) |
| | 823 | $cache = array(); |
| | 824 | if ( ! $is_customize_preview ) { |
| | 825 | $cache = wp_cache_get('widget_recent_comments', 'widget'); |
| | 826 | } |
| | 827 | if ( ! is_array( $cache ) ) { |
| 813 | 828 | $cache = array(); |
| | 829 | } |
| 814 | 830 | |
| 815 | 831 | if ( ! isset( $args['widget_id'] ) ) |
| 816 | 832 | $args['widget_id'] = $this->id; |
| … |
… |
class WP_Widget_Recent_Comments extends WP_Widget { |
| 865 | 881 | $output .= $after_widget; |
| 866 | 882 | |
| 867 | 883 | echo $output; |
| 868 | | $cache[$args['widget_id']] = $output; |
| 869 | | wp_cache_set('widget_recent_comments', $cache, 'widget'); |
| | 884 | |
| | 885 | if ( ! $is_customize_preview ) { |
| | 886 | $cache[ $args['widget_id'] ] = $output; |
| | 887 | wp_cache_set( 'widget_recent_comments', $cache, 'widget' ); |
| | 888 | } |
| 870 | 889 | } |
| 871 | 890 | |
| 872 | 891 | function update( $new_instance, $old_instance ) { |