Changeset 11088 for trunk/wp-includes/default-widgets.php
- Timestamp:
- 04/26/2009 05:34:06 AM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-includes/default-widgets.php
r11087 r11088 496 496 function WP_Widget_Recent_Posts() { 497 497 $widget_ops = array('classname' => 'widget_recent_entries', 'description' => __( "The most recent posts on your blog") ); 498 $this->WP_Widget('recent_posts', __('Recent Posts'), $widget_ops); 498 $this->WP_Widget('recent-posts', __('Recent Posts'), $widget_ops); 499 $this->alt_option_name = 'widget_recent_entries'; 499 500 500 501 add_action( 'save_post', array(&$this, 'flush_widget_cache') ); … … 504 505 505 506 function widget($args, $instance) { 506 if ( $output = wp_cache_get('widget_recent_ entries', 'widget') )507 if ( $output = wp_cache_get('widget_recent_posts' . $args['widget_id'], 'widget') ) 507 508 return print($output); 508 509 509 510 ob_start(); 510 511 511 extract($args); 512 512 … … 518 518 else if ( $number > 15 ) 519 519 $number = 15; 520 520 521 521 $r = new WP_Query(array('showposts' => $number, 'what_to_show' => 'posts', 'nopaging' => 0, 'post_status' => 'publish', 'caller_get_posts' => 1)); 522 522 if ($r->have_posts()) : … … 533 533 wp_reset_query(); // Restore global post data stomped by the_post(). 534 534 endif; 535 536 wp_cache_add('widget_recent_ entries', ob_get_flush(), 'widget');535 536 wp_cache_add('widget_recent_posts' . $args['widget_id'], ob_get_flush(), 'widget'); 537 537 } 538 538 … … 542 542 $instance['number'] = (int) $new_instance['number']; 543 543 $this->flush_widget_cache(); 544 545 $alloptions = wp_cache_get( 'alloptions', 'options' ); 546 if ( isset($alloptions['widget_recent_entries']) ) 547 delete_option('widget_recent_entries'); 544 548 545 549 return $instance;
Note: See TracChangeset
for help on using the changeset viewer.