Ticket #10131: default-widgets.patch
| File default-widgets.patch, 2.8 KB (added by , 16 years ago) |
|---|
-
wp-includes/default-widgets.php
406 406 407 407 <textarea class="widefat" rows="16" cols="20" id="<?php echo $this->get_field_id('text'); ?>" name="<?php echo $this->get_field_name('text'); ?>"><?php echo $text; ?></textarea> 408 408 409 <p><input id="<?php echo $this->get_field_id('filter'); ?>" name="<?php echo $this->get_field_name('filter'); ?>" type="checkbox" <?php checked( $instance['filter']); ?> /> <label for="<?php echo $this->get_field_id('filter'); ?>"><?php _e('Automatically add paragraphs.'); ?></label></p>409 <p><input id="<?php echo $this->get_field_id('filter'); ?>" name="<?php echo $this->get_field_name('filter'); ?>" type="checkbox" <?php checked(isset($instance['filter']) ? $instance['filter'] : 0); ?> /> <label for="<?php echo $this->get_field_id('filter'); ?>"><?php _e('Automatically add paragraphs.'); ?></label></p> 410 410 <?php 411 411 } 412 412 } … … 483 483 //Defaults 484 484 $instance = wp_parse_args( (array) $instance, array( 'title' => '') ); 485 485 $title = esc_attr( $instance['title'] ); 486 $count = (bool) $instance['count'];487 $hierarchical = (bool) $instance['hierarchical'];488 $dropdown = (bool) $instance['dropdown'];486 $count = isset($instance['count']) ? (bool) $instance['count'] :false; 487 $hierarchical = isset( $instance['hierarchical'] ) ? (bool) $instance['hierarchical'] : false; 488 $dropdown = isset( $instance['dropdown'] ) ? (bool) $instance['dropdown'] : false; 489 489 ?> 490 490 <p><label for="<?php echo $this->get_field_id('title'); ?>"><?php _e( 'Title:' ); ?></label> 491 491 <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> … … 577 577 } 578 578 579 579 function form( $instance ) { 580 $title = esc_attr($instance['title']);581 if ( ! $number = (int) $instance['number'] )580 $title = isset($instance['title']) ? esc_attr($instance['title']) : ''; 581 if ( !isset($instance['number']) || !$number = (int) $instance['number'] ) 582 582 $number = 5; 583 583 ?> 584 584 <p><label for="<?php echo $this->get_field_id('title'); ?>"><?php _e('Title:'); ?></label> … … 983 983 function form( $instance ) { 984 984 ?> 985 985 <p><label for="<?php echo $this->get_field_id('title'); ?>"><?php _e('Title:') ?></label> 986 <input type="text" class="widefat" id="<?php echo $this->get_field_id('title'); ?>" name="<?php echo $this->get_field_name('title'); ?>" value="<?php echo esc_attr( $instance['title'] );?>" /></p>986 <input type="text" class="widefat" id="<?php echo $this->get_field_id('title'); ?>" name="<?php echo $this->get_field_name('title'); ?>" value="<?php if (isset ( $instance['title'])) {echo esc_attr( $instance['title'] );} ?>" /></p> 987 987 <?php 988 988 } 989 989 }