diff --git src/wp-admin/css/customize-controls.css src/wp-admin/css/customize-controls.css
index 448f1b5..4ffe269 100644
|
|
body { |
157 | 157 | line-height: 28px; |
158 | 158 | } |
159 | 159 | |
160 | | .customize-control input[type="text"] { |
| 160 | .customize-control:not(.customize-control-widget_form) input[type="text"] { |
161 | 161 | width: 98%; |
162 | 162 | line-height: 18px; |
163 | 163 | margin: 0; |
164 | 164 | } |
165 | 165 | |
166 | | .customize-control select { |
| 166 | .customize-control:not(.customize-control-widget_form) select { |
167 | 167 | min-width: 50%; |
168 | 168 | max-width: 100%; |
169 | 169 | height: 28px; |
diff --git src/wp-admin/css/widgets.css src/wp-admin/css/widgets.css
index 75014f6..49a1561 100644
|
|
div#widgets-right .widget-top:hover, |
501 | 501 | cursor: pointer; |
502 | 502 | } |
503 | 503 | |
| 504 | /* Specific widgets */ |
| 505 | |
| 506 | .widget input[type="number"][size="3"] { |
| 507 | width: 3em; |
| 508 | } |
| 509 | |
504 | 510 | /* =Media Queries |
505 | 511 | -------------------------------------------------------------- */ |
506 | 512 | |
diff --git src/wp-includes/default-widgets.php src/wp-includes/default-widgets.php
index 851e94c..7a1017e 100644
|
|
class WP_Widget_Links extends WP_Widget { |
175 | 175 | <label for="<?php echo $this->get_field_id('rating'); ?>"><?php _e('Show Link Rating'); ?></label> |
176 | 176 | </p> |
177 | 177 | <p> |
178 | | <label for="<?php echo $this->get_field_id('limit'); ?>"><?php _e( 'Number of links to show:' ); ?></label> |
179 | | <input id="<?php echo $this->get_field_id('limit'); ?>" name="<?php echo $this->get_field_name('limit'); ?>" type="text" value="<?php echo $limit == -1 ? '' : intval( $limit ); ?>" size="3" /> |
| 178 | <label for="<?php echo $this->get_field_id( 'limit' ); ?>"><?php _e( 'Number of links to show:' ); ?></label> |
| 179 | <input id="<?php echo $this->get_field_id( 'limit' ); ?>" name="<?php echo $this->get_field_name( 'limit' ); ?>" type="number" value="<?php echo $limit == -1 ? '' : intval( $limit ); ?>" size="3" /> |
180 | 180 | </p> |
181 | 181 | <?php |
182 | 182 | } |
… |
… |
class WP_Widget_Categories extends WP_Widget { |
531 | 531 | * @since 2.8.0 |
532 | 532 | */ |
533 | 533 | class WP_Widget_Recent_Posts extends WP_Widget { |
| 534 | const DEFAULT_NUMBER = 5; |
534 | 535 | |
535 | 536 | function __construct() { |
536 | 537 | $widget_ops = array('classname' => 'widget_recent_entries', 'description' => __( "Your site’s most recent Posts.") ); |
… |
… |
class WP_Widget_Recent_Posts extends WP_Widget { |
561 | 562 | |
562 | 563 | $title = ( ! empty( $instance['title'] ) ) ? $instance['title'] : __( 'Recent Posts' ); |
563 | 564 | $title = apply_filters( 'widget_title', $title, $instance, $this->id_base ); |
564 | | $number = ( ! empty( $instance['number'] ) ) ? absint( $instance['number'] ) : 10; |
565 | | if ( ! $number ) |
566 | | $number = 10; |
| 565 | $number = ( ! empty( $instance['number'] ) ) ? absint( $instance['number'] ) : self::DEFAULT_NUMBER; |
| 566 | if ( ! $number ) { |
| 567 | $number = self::DEFAULT_NUMBER; |
| 568 | } |
567 | 569 | $show_date = isset( $instance['show_date'] ) ? $instance['show_date'] : false; |
568 | 570 | |
569 | 571 | $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 ) ) ); |
… |
… |
class WP_Widget_Recent_Posts extends WP_Widget { |
612 | 614 | |
613 | 615 | function form( $instance ) { |
614 | 616 | $title = isset( $instance['title'] ) ? esc_attr( $instance['title'] ) : ''; |
615 | | $number = isset( $instance['number'] ) ? absint( $instance['number'] ) : 5; |
| 617 | $number = isset( $instance['number'] ) ? absint( $instance['number'] ) : self::DEFAULT_NUMBER; |
616 | 618 | $show_date = isset( $instance['show_date'] ) ? (bool) $instance['show_date'] : false; |
617 | 619 | ?> |
618 | 620 | <p><label for="<?php echo $this->get_field_id( 'title' ); ?>"><?php _e( 'Title:' ); ?></label> |
619 | 621 | <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> |
620 | 622 | |
621 | 623 | <p><label for="<?php echo $this->get_field_id( 'number' ); ?>"><?php _e( 'Number of posts to show:' ); ?></label> |
622 | | <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> |
| 624 | <input id="<?php echo $this->get_field_id( 'number' ); ?>" name="<?php echo $this->get_field_name( 'number' ); ?>" type="number" min="1" value="<?php echo $number; ?>" size="3" /></p> |
623 | 625 | |
624 | 626 | <p><input class="checkbox" type="checkbox" <?php checked( $show_date ); ?> id="<?php echo $this->get_field_id( 'show_date' ); ?>" name="<?php echo $this->get_field_name( 'show_date' ); ?>" /> |
625 | 627 | <label for="<?php echo $this->get_field_id( 'show_date' ); ?>"><?php _e( 'Display post date?' ); ?></label></p> |