WordPress.org

Make WordPress Core

Ticket #17863: options-discussion.php.diff

File options-discussion.php.diff, 1011 bytes (added by trepmal, 6 years ago)

change 'nested comment depth' field from <select> to type=number

  • wp-admin/options-discussion.php

     
    7878<?php
    7979
    8080$maxdeep = (int) apply_filters( 'thread_comments_depth_max', 10 );
     81$thread_comments_depth = "</label><input name='thread_comments_depth' type='number' min='2' max='$maxdeep' step='1' id='thread_comments_depth' value='". get_option('thread_comments_depth') ."' />";
    8182
    82 $thread_comments_depth = '</label><select name="thread_comments_depth" id="thread_comments_depth">';
    83 for ( $i = 2; $i <= $maxdeep; $i++ ) {
    84         $thread_comments_depth .= "<option value='" . esc_attr($i) . "'";
    85         if ( get_option('thread_comments_depth') == $i ) $thread_comments_depth .= " selected='selected'";
    86         $thread_comments_depth .= ">$i</option>";
    87 }
    88 $thread_comments_depth .= '</select>';
    89 
    9083printf( __('Enable threaded (nested) comments %s levels deep'), $thread_comments_depth );
    9184
    9285?><br />