Widgets: use input[type="number"] for the number prop in the Recent Posts and Recent Comments widget forms.

Props helen, obenland, mordauk.
Fixes #22965.


git-svn-id: https://develop.svn.wordpress.org/trunk@34514 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Scott Taylor 2015-09-24 19:52:06 +00:00
parent 075245d894
commit 395fc15df3
3 changed files with 15 additions and 2 deletions

View File

@ -67,6 +67,11 @@ input[type="url"] {
direction: ltr;
}
/* Vertically align the number selector with the input. */
input[type="number"] {
line-height: inherit;
}
input[type="checkbox"],
input[type="radio"] {
border: 1px solid #b4b9be;
@ -385,6 +390,14 @@ input[type="number"].small-text {
width: 65px;
}
input.tiny-text {
width: 35px;
}
input[type="number"].tiny-text {
width: 45px;
}
#doaction,
#doaction2,
#post-query-submit {

View File

@ -164,7 +164,7 @@ class WP_Widget_Recent_Comments extends WP_Widget {
<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>
<p><label for="<?php echo $this->get_field_id( 'number' ); ?>"><?php _e( 'Number of comments to show:' ); ?></label>
<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>
<input class="tiny-text" id="<?php echo $this->get_field_id( 'number' ); ?>" name="<?php echo $this->get_field_name( 'number' ); ?>" type="number" step="1" min="1" value="<?php echo $number; ?>" size="3" /></p>
<?php
}
}

View File

@ -106,7 +106,7 @@ class WP_Widget_Recent_Posts extends WP_Widget {
<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>
<p><label for="<?php echo $this->get_field_id( 'number' ); ?>"><?php _e( 'Number of posts to show:' ); ?></label>
<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>
<input class="tiny-text" id="<?php echo $this->get_field_id( 'number' ); ?>" name="<?php echo $this->get_field_name( 'number' ); ?>" type="number" step="1" min="1" value="<?php echo $number; ?>" size="3" /></p>
<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' ); ?>" />
<label for="<?php echo $this->get_field_id( 'show_date' ); ?>"><?php _e( 'Display post date?' ); ?></label></p>