WordPress.org

Make WordPress Core

Ticket #22965: recent_comments_number_field.patch

File recent_comments_number_field.patch, 1.6 KB (added by mordauk, 16 months ago)

Patch for both dashboard recent comments and main widget

  • wp-includes/default-widgets.php

     
    723723                <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> 
    724724 
    725725                <p><label for="<?php echo $this->get_field_id('number'); ?>"><?php _e('Number of comments to show:'); ?></label> 
    726                 <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> 
     726                <input id="<?php echo $this->get_field_id('number'); ?>" name="<?php echo $this->get_field_name('number'); ?>" type="number" value="<?php echo $number; ?>" size="3" /></p> 
    727727<?php 
    728728        } 
    729729} 
  • wp-admin/includes/dashboard.php

     
    766766        $number = isset( $widget_options['dashboard_recent_comments']['items'] ) ? (int) $widget_options['dashboard_recent_comments']['items'] : ''; 
    767767 
    768768        echo '<p><label for="comments-number">' . __('Number of comments to show:') . '</label>'; 
    769         echo '<input id="comments-number" name="widget-recent-comments[items]" type="text" value="' . $number . '" size="3" /></p>'; 
     769        echo '<input id="comments-number" name="widget-recent-comments[items]" type="number" value="' . $number . '" size="3" /></p>'; 
    770770} 
    771771 
    772772function wp_dashboard_incoming_links() {