X-Git-Url: https://scripts.mit.edu/gitweb/autoinstalls/wordpress.git/blobdiff_plain/8f374b7233bc2815ccc387e448d208c5434eb961..c55863f11e8589bf8d4a5698bf15752406654f1c:/wp-includes/default-widgets.php diff --git a/wp-includes/default-widgets.php b/wp-includes/default-widgets.php index e4856dac..84bc7af6 100644 --- a/wp-includes/default-widgets.php +++ b/wp-includes/default-widgets.php @@ -150,8 +150,8 @@ class WP_Widget_Links extends WP_Widget { term_id) . '"' - . ( $link_cat->term_id == $instance['category'] ? ' selected="selected"' : '' ) + echo '\n"; } ?> @@ -161,7 +161,7 @@ class WP_Widget_Links extends WP_Widget { - +

@@ -315,10 +315,11 @@ class WP_Widget_Meta extends WP_Widget {

  • RSS'); ?>
  • RSS'); ?>
  • -
  • + %s', + esc_url( __( 'http://wordpress.org/' ) ), + esc_attr__( 'Powered by WordPress, state-of-the-art semantic personal publishing platform.' ), + _x( 'WordPress.org', 'meta widget link text' ) + ) ); ?> id_base); + $title = apply_filters('widget_title', empty($instance['title']) ? '' : $instance['title'], $instance, $this->id_base); echo $before_widget; if ( $title ) echo $before_title . $title . $after_title; @@ -536,9 +537,9 @@ class WP_Widget_Recent_Posts extends WP_Widget { parent::__construct('recent-posts', __('Recent Posts'), $widget_ops); $this->alt_option_name = 'widget_recent_entries'; - add_action( 'save_post', array(&$this, 'flush_widget_cache') ); - add_action( 'deleted_post', array(&$this, 'flush_widget_cache') ); - add_action( 'switch_theme', array(&$this, 'flush_widget_cache') ); + add_action( 'save_post', array($this, 'flush_widget_cache') ); + add_action( 'deleted_post', array($this, 'flush_widget_cache') ); + add_action( 'switch_theme', array($this, 'flush_widget_cache') ); } function widget($args, $instance) { @@ -558,9 +559,12 @@ class WP_Widget_Recent_Posts extends WP_Widget { ob_start(); extract($args); - $title = apply_filters('widget_title', empty($instance['title']) ? __('Recent Posts') : $instance['title'], $instance, $this->id_base); - if ( empty( $instance['number'] ) || ! $number = absint( $instance['number'] ) ) + $title = ( ! empty( $instance['title'] ) ) ? $instance['title'] : __( 'Recent Posts' ); + $title = apply_filters( 'widget_title', $title, $instance, $this->id_base ); + $number = ( ! empty( $instance['number'] ) ) ? absint( $instance['number'] ) : 10; + if ( ! $number ) $number = 10; + $show_date = isset( $instance['show_date'] ) ? $instance['show_date'] : false; $r = new WP_Query( apply_filters( 'widget_posts_args', array( 'posts_per_page' => $number, 'no_found_rows' => true, 'post_status' => 'publish', 'ignore_sticky_posts' => true ) ) ); if ($r->have_posts()) : @@ -568,8 +572,13 @@ class WP_Widget_Recent_Posts extends WP_Widget { @@ -587,6 +596,7 @@ class WP_Widget_Recent_Posts extends WP_Widget { $instance = $old_instance; $instance['title'] = strip_tags($new_instance['title']); $instance['number'] = (int) $new_instance['number']; + $instance['show_date'] = isset( $new_instance['show_date'] ) ? (bool) $new_instance['show_date'] : false; $this->flush_widget_cache(); $alloptions = wp_cache_get( 'alloptions', 'options' ); @@ -601,14 +611,18 @@ class WP_Widget_Recent_Posts extends WP_Widget { } function form( $instance ) { - $title = isset($instance['title']) ? esc_attr($instance['title']) : ''; - $number = isset($instance['number']) ? absint($instance['number']) : 5; + $title = isset( $instance['title'] ) ? esc_attr( $instance['title'] ) : ''; + $number = isset( $instance['number'] ) ? absint( $instance['number'] ) : 5; + $show_date = isset( $instance['show_date'] ) ? (bool) $instance['show_date'] : false; ?> -

    -

    +

    +

    + +

    +

    -

    -

    +

    id="get_field_id( 'show_date' ); ?>" name="get_field_name( 'show_date' ); ?>" /> +

    alt_option_name = 'widget_recent_comments'; if ( is_active_widget(false, false, $this->id_base) ) - add_action( 'wp_head', array(&$this, 'recent_comments_style') ); + add_action( 'wp_head', array($this, 'recent_comments_style') ); - add_action( 'comment_post', array(&$this, 'flush_widget_cache') ); - add_action( 'transition_comment_status', array(&$this, 'flush_widget_cache') ); + add_action( 'comment_post', array($this, 'flush_widget_cache') ); + add_action( 'edit_comment', array($this, 'flush_widget_cache') ); + add_action( 'transition_comment_status', array($this, 'flush_widget_cache') ); } function recent_comments_style() { @@ -663,9 +678,11 @@ class WP_Widget_Recent_Comments extends WP_Widget { extract($args, EXTR_SKIP); $output = ''; - $title = apply_filters( 'widget_title', empty( $instance['title'] ) ? __( 'Recent Comments' ) : $instance['title'], $instance, $this->id_base ); - if ( empty( $instance['number'] ) || ! $number = absint( $instance['number'] ) ) + $title = ( ! empty( $instance['title'] ) ) ? $instance['title'] : __( 'Recent Comments' ); + $title = apply_filters( 'widget_title', $title, $instance, $this->id_base ); + $number = ( ! empty( $instance['number'] ) ) ? absint( $instance['number'] ) : 5; + if ( ! $number ) $number = 5; $comments = get_comments( apply_filters( 'widget_comments_args', array( 'number' => $number, 'status' => 'approve', 'post_status' => 'publish' ) ) ); @@ -675,6 +692,10 @@ class WP_Widget_Recent_Comments extends WP_Widget { $output .= '