Changes from branches/3.0/wp-includes/default-widgets.php at r15317 to trunk/wp-includes/default-widgets.php at r17260
- File:
-
- 1 edited
-
trunk/wp-includes/default-widgets.php (modified) (12 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-includes/default-widgets.php
r15317 r17260 1 1 <?php 2 3 2 /** 4 3 * Default Widgets … … 263 262 <p><label for="<?php echo $this->get_field_id('title'); ?>"><?php _e('Title:'); ?></label> <input class="widefat" id="<?php echo $this->get_field_id('title'); ?>" name="<?php echo $this->get_field_name('title'); ?>" type="text" value="<?php echo esc_attr($title); ?>" /></p> 264 263 <p> 264 <input class="checkbox" type="checkbox" <?php echo $dropdown; ?> id="<?php echo $this->get_field_id('dropdown'); ?>" name="<?php echo $this->get_field_name('dropdown'); ?>" /> <label for="<?php echo $this->get_field_id('dropdown'); ?>"><?php _e('Display as dropdown'); ?></label> 265 <br/> 265 266 <input class="checkbox" type="checkbox" <?php echo $count; ?> id="<?php echo $this->get_field_id('count'); ?>" name="<?php echo $this->get_field_name('count'); ?>" /> <label for="<?php echo $this->get_field_id('count'); ?>"><?php _e('Show post counts'); ?></label> 266 <br />267 <input class="checkbox" type="checkbox" <?php echo $dropdown; ?> id="<?php echo $this->get_field_id('dropdown'); ?>" name="<?php echo $this->get_field_name('dropdown'); ?>" /> <label for="<?php echo $this->get_field_id('dropdown'); ?>"><?php _e('Display as a drop down'); ?></label>268 267 </p> 269 268 <?php … … 400 399 $instance = wp_parse_args( (array) $instance, array( 'title' => '', 'text' => '' ) ); 401 400 $title = strip_tags($instance['title']); 402 $text = format_to_edit($instance['text']);401 $text = esc_textarea($instance['text']); 403 402 ?> 404 403 <p><label for="<?php echo $this->get_field_id('title'); ?>"><?php _e('Title:'); ?></label> … … 492 491 493 492 <p><input type="checkbox" class="checkbox" id="<?php echo $this->get_field_id('dropdown'); ?>" name="<?php echo $this->get_field_name('dropdown'); ?>"<?php checked( $dropdown ); ?> /> 494 <label for="<?php echo $this->get_field_id('dropdown'); ?>"><?php _e( ' Showas dropdown' ); ?></label><br />493 <label for="<?php echo $this->get_field_id('dropdown'); ?>"><?php _e( 'Display as dropdown' ); ?></label><br /> 495 494 496 495 <input type="checkbox" class="checkbox" id="<?php echo $this->get_field_id('count'); ?>" name="<?php echo $this->get_field_name('count'); ?>"<?php checked( $count ); ?> /> … … 536 535 537 536 $title = apply_filters('widget_title', empty($instance['title']) ? __('Recent Posts') : $instance['title'], $instance, $this->id_base); 538 if ( !$number = (int) $instance['number'] ) 539 $number = 10; 540 else if ( $number < 1 ) 541 $number = 1; 542 else if ( $number > 15 ) 543 $number = 15; 544 545 $r = new WP_Query(array('showposts' => $number, 'nopaging' => 0, 'post_status' => 'publish', 'caller_get_posts' => 1)); 537 if ( ! $number = absint( $instance['number'] ) ) 538 $number = 10; 539 540 $r = new WP_Query(array('posts_per_page' => $number, 'nopaging' => 0, 'post_status' => 'publish', 'ignore_sticky_posts' => true)); 546 541 if ($r->have_posts()) : 547 542 ?> … … 583 578 function form( $instance ) { 584 579 $title = isset($instance['title']) ? esc_attr($instance['title']) : ''; 585 if ( !isset($instance['number']) || !$number = (int) $instance['number'] ) 586 $number = 5; 580 $number = isset($instance['number']) ? absint($instance['number']) : 5; 587 581 ?> 588 582 <p><label for="<?php echo $this->get_field_id('title'); ?>"><?php _e('Title:'); ?></label> … … 614 608 } 615 609 616 function recent_comments_style() { ?> 610 function recent_comments_style() { 611 if ( ! current_theme_supports( 'widgets' ) // Temp hack #14876 612 || ! apply_filters( 'show_recent_comments_widget_style', true, $this->id_base ) ) 613 return; 614 ?> 617 615 <style type="text/css">.recentcomments a{display:inline !important;padding:0 !important;margin:0 !important;}</style> 618 616 <?php … … 640 638 $title = apply_filters('widget_title', empty($instance['title']) ? __('Recent Comments') : $instance['title']); 641 639 642 if ( ! $number = (int) $instance['number'])640 if ( ! $number = absint( $instance['number'] ) ) 643 641 $number = 5; 644 else if ( $number < 1 )645 $number = 1;646 642 647 643 $comments = get_comments( array( 'number' => $number, 'status' => 'approve' ) ); … … 667 663 $instance = $old_instance; 668 664 $instance['title'] = strip_tags($new_instance['title']); 669 $instance['number'] = (int) $new_instance['number'];665 $instance['number'] = absint( $new_instance['number'] ); 670 666 $this->flush_widget_cache(); 671 667 … … 715 711 716 712 if ( empty($url) ) 713 return; 714 715 // self-url destruction sequence 716 if ( $url == site_url() || $url == home_url() ) 717 717 return; 718 718 … … 837 837 $date = ''; 838 838 if ( $show_date ) { 839 $date = $item->get_date( );839 $date = $item->get_date( 'U' ); 840 840 841 841 if ( $date ) { 842 if ( $date_stamp = strtotime( $date ) ) 843 $date = ' <span class="rss-date">' . date_i18n( get_option( 'date_format' ), $date_stamp ) . '</span>'; 844 else 845 $date = ''; 842 $date = ' <span class="rss-date">' . date_i18n( get_option( 'date_format' ), $date ) . '</span>'; 846 843 } 847 844 } … … 1012 1009 if ( $title ) 1013 1010 echo $before_title . $title . $after_title; 1014 echo '<div >';1011 echo '<div class="tagcloud">'; 1015 1012 wp_tag_cloud( apply_filters('widget_tag_cloud_args', array('taxonomy' => $current_taxonomy) ) ); 1016 1013 echo "</div>\n";
Note: See TracChangeset
for help on using the changeset viewer.