Changeset 23597
- Timestamp:
- 03/04/2013 02:14:23 AM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-includes/default-widgets.php
r23554 r23597 560 560 extract($args); 561 561 562 $title = apply_filters('widget_title', empty($instance['title']) ? __('Recent Posts') : $instance['title'], $instance, $this->id_base); 563 if ( empty( $instance['number'] ) || ! $number = absint( $instance['number'] ) ) 562 $title = ( ! empty( $instance['title'] ) ) ? $instance['title'] : __( 'Recent Posts' ); 563 $title = apply_filters( 'widget_title', $title, $instance, $this->id_base ); 564 $number = ( ! empty( $instance['number'] ) ) ? absint( $instance['number'] ) : 10; 565 if ( ! $number ) 564 566 $number = 10; 565 567 $show_date = isset( $instance['show_date'] ) ? $instance['show_date'] : false; … … 676 678 extract($args, EXTR_SKIP); 677 679 $output = ''; 678 $title = apply_filters( 'widget_title', empty( $instance['title'] ) ? __( 'Recent Comments' ) : $instance['title'], $instance, $this->id_base ); 679 680 if ( empty( $instance['number'] ) || ! $number = absint( $instance['number'] ) ) 680 681 $title = ( ! empty( $instance['title'] ) ) ? $instance['title'] : __( 'Recent Comments' ); 682 $title = apply_filters( 'widget_title', $title, $instance, $this->id_base ); 683 $number = ( ! empty( $instance['number'] ) ) ? absint( $instance['number'] ) : 5; 684 if ( ! $number ) 681 685 $number = 5; 682 686 … … 718 722 719 723 function form( $instance ) { 720 $title = isset($instance['title']) ? esc_attr($instance['title']) : '';721 $number = isset( $instance['number']) ? absint($instance['number']) : 5;722 ?> 723 <p><label for="<?php echo $this->get_field_id( 'title'); ?>"><?php _e('Title:'); ?></label>724 <input class="widefat" id="<?php echo $this->get_field_id( 'title'); ?>" name="<?php echo $this->get_field_name('title'); ?>" type="text" value="<?php echo $title; ?>" /></p>725 726 <p><label for="<?php echo $this->get_field_id( 'number'); ?>"><?php _e('Number of comments to show:'); ?></label>727 <input id="<?php echo $this->get_field_id( 'number'); ?>" name="<?php echo $this->get_field_name('number'); ?>" type="text" value="<?php echo $number; ?>" size="3" /></p>724 $title = isset( $instance['title'] ) ? esc_attr( $instance['title'] ) : ''; 725 $number = isset( $instance['number'] ) ? absint( $instance['number'] ) : 5; 726 ?> 727 <p><label for="<?php echo $this->get_field_id( 'title' ); ?>"><?php _e( 'Title:' ); ?></label> 728 <input class="widefat" id="<?php echo $this->get_field_id( 'title' ); ?>" name="<?php echo $this->get_field_name( 'title' ); ?>" type="text" value="<?php echo $title; ?>" /></p> 729 730 <p><label for="<?php echo $this->get_field_id( 'number' ); ?>"><?php _e( 'Number of comments to show:' ); ?></label> 731 <input id="<?php echo $this->get_field_id( 'number' ); ?>" name="<?php echo $this->get_field_name( 'number' ); ?>" type="text" value="<?php echo $number; ?>" size="3" /></p> 728 732 <?php 729 733 }
Note: See TracChangeset
for help on using the changeset viewer.