mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-08-11 12:20:22 +00:00
Set a consistent cache key when using the_widget to display the Recent Posts and Recent Comments widgets so that they get cached. See #16761.
git-svn-id: https://develop.svn.wordpress.org/trunk@18677 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -525,7 +525,10 @@ class WP_Widget_Recent_Posts extends WP_Widget {
|
||||
if ( !is_array($cache) )
|
||||
$cache = array();
|
||||
|
||||
if ( isset( $args['widget_id'] ) && isset( $cache[ $args['widget_id'] ] ) ) {
|
||||
if ( ! isset( $args['widget_id'] ) )
|
||||
$args['widget_id'] = $this->id;
|
||||
|
||||
if ( false && isset( $cache[ $args['widget_id'] ] ) ) {
|
||||
echo $cache[ $args['widget_id'] ];
|
||||
return;
|
||||
}
|
||||
@@ -628,7 +631,10 @@ class WP_Widget_Recent_Comments extends WP_Widget {
|
||||
if ( ! is_array( $cache ) )
|
||||
$cache = array();
|
||||
|
||||
if ( isset( $args['widget_id'] ) && isset( $cache[ $args['widget_id'] ] ) ) {
|
||||
if ( ! isset( $args['widget_id'] ) )
|
||||
$args['widget_id'] = $this->id;
|
||||
|
||||
if ( false && isset( $cache[ $args['widget_id'] ] ) ) {
|
||||
echo $cache[ $args['widget_id'] ];
|
||||
return;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user