Make WordPress Core

Ticket #31354: 31354.6.patch

File 31354.6.patch, 8.9 KB (added by jwgoedert, 6 months ago)

Adjusted previous patch to remove js and php toggle disable setting to focus on structural changes only(bug related)

  • src/wp-admin/css/edit.css

    diff --git a/src/wp-admin/css/edit.css b/src/wp-admin/css/edit.css
    index 757d676b72..fa94499735 100644
    a b div.tabs-panel-active:focus { 
    12971297        /* Only visible in Windows High Contrast mode */
    12981298        outline: 2px solid transparent;
    12991299}
    1300 
     1300.options-discussion-php .indent-children ul,
    13011301#front-page-warning,
    13021302#front-static-pages ul,
    13031303ul.export-filters,
  • src/wp-admin/options-discussion.php

    diff --git a/src/wp-admin/options-discussion.php b/src/wp-admin/options-discussion.php
    index 19e3c45dc8..f2e50b68dc 100644
    a b require_once ABSPATH . 'wp-admin/admin-header.php'; 
    3939<div class="wrap">
    4040<h1><?php echo esc_html( $title ); ?></h1>
    4141
     42<!-- ARIA live region for screen readers -->
     43<div id="aria-live-region" aria-live="polite" class="screen-reader-text"></div>
     44
     45
    4246<form method="post" action="options.php">
    4347<?php settings_fields( 'discussion' ); ?>
    4448
    45 <table class="form-table" role="presentation">
     49<table class="form-table indent-children" role="presentation">
    4650<tr>
    4751<th scope="row"><?php _e( 'Default post settings' ); ?></th>
    4852<td><fieldset><legend class="screen-reader-text"><span>
    if ( ! get_option( 'users_can_register' ) && is_multisite() ) { 
    8690?>
    8791</label>
    8892<br />
    89 
    90 <label for="close_comments_for_old_posts">
    91 <input name="close_comments_for_old_posts" type="checkbox" id="close_comments_for_old_posts" value="1" <?php checked( '1', get_option( 'close_comments_for_old_posts' ) ); ?> />
     93<input name="close_comments_for_old_posts" type="checkbox" id="close_comments_for_old_posts" value="1" <?php checked( '1', get_option( 'close_comments_for_old_posts' ) ); ?> /> <label for="close_comments_for_old_posts"><?php _e( 'Automatically close comments for old posts' ); ?></label>
     94<br />
    9295<?php
    93 printf(
    94         /* translators: %s: Number of days. */
    95         __( 'Automatically close comments on posts older than %s days' ),
    96         '</label> <label for="close_comments_days_old"><input name="close_comments_days_old" type="number" min="0" step="1" id="close_comments_days_old" value="' . esc_attr( get_option( 'close_comments_days_old' ) ) . '" class="small-text" />'
    97 );
    9896?>
    99 </label>
    100 <br />
     97<ul>
     98        <li>
     99                <label for="close_comments_days_old"><?php _e( 'Number of days to keep old comments' ); ?></label>
     100                <input name="close_comments_days_old" type="number" step="1" min="0" id="close_comments_days_old" value="<?php echo esc_attr( get_option( 'close_comments_days_old' ) ); ?>" class="small-text"/>
     101        </li>
     102</ul>
    101103
    102 <label for="show_comments_cookies_opt_in">
    103104<input name="show_comments_cookies_opt_in" type="checkbox" id="show_comments_cookies_opt_in" value="1" <?php checked( '1', get_option( 'show_comments_cookies_opt_in' ) ); ?> />
    104 <?php _e( 'Show comments cookies opt-in checkbox, allowing comment author cookies to be set' ); ?>
    105 </label>
     105<label for="show_comments_cookies_opt_in"><?php _e( 'Show comments cookies opt-in checkbox, allowing comment author cookies to be set' ); ?></label>
    106106<br />
    107 
    108 <label for="thread_comments">
    109107<input name="thread_comments" type="checkbox" id="thread_comments" value="1" <?php checked( '1', get_option( 'thread_comments' ) ); ?> />
     108<label for="thread_comments"><?php _e( 'Enable threaded (nested) comments' ); ?></label>
     109
    110110<?php
    111111/**
    112112 * Filters the maximum depth of threaded/nested comments.
    printf( 
    117117 */
    118118$maxdeep = (int) apply_filters( 'thread_comments_depth_max', 10 );
    119119
    120 $thread_comments_depth = '</label> <label for="thread_comments_depth"><select name="thread_comments_depth" id="thread_comments_depth">';
     120$thread_comments_depth = '<select name="thread_comments_depth" id="thread_comments_depth">';
    121121for ( $i = 2; $i <= $maxdeep; $i++ ) {
    122122        $thread_comments_depth .= "<option value='" . esc_attr( $i ) . "'";
    123123        if ( (int) get_option( 'thread_comments_depth' ) === $i ) {
    for ( $i = 2; $i <= $maxdeep; $i++ ) { 
    126126        $thread_comments_depth .= ">$i</option>";
    127127}
    128128$thread_comments_depth .= '</select>';
    129 
    130 /* translators: %s: Number of levels. */
    131 printf( __( 'Enable threaded (nested) comments %s levels deep' ), $thread_comments_depth );
    132 
    133129?>
    134 </label>
    135 <br />
    136 <label for="page_comments">
     130<ul>
     131        <li>
     132                <label for="thread_comments_depth"><?php _e( 'Number of levels for threaded (nested) comments' ); ?></label>
     133                <?php echo $thread_comments_depth; ?>
     134        </li>
     135</ul>
     136</fieldset></td>
     137</tr>
     138
     139<tr>
     140<th scope="row"><?php _e( 'Comment Pagination' ); ?></th>
     141<td><fieldset><legend class="screen-reader-text"><span>
     142        <?php
     143        /* translators: Hidden accessibility text. */
     144        _e( 'Comment Pagination' );
     145        ?>
     146</span></legend>
    137147<input name="page_comments" type="checkbox" id="page_comments" value="1" <?php checked( '1', get_option( 'page_comments' ) ); ?> />
     148<label for="page_comments"><?php _e( 'Break comments into pages' ); ?></label>
    138149<?php
    139 $default_comments_page = '</label> <label for="default_comments_page"><select name="default_comments_page" id="default_comments_page"><option value="newest"';
    140 if ( 'newest' === get_option( 'default_comments_page' ) ) {
    141         $default_comments_page .= ' selected="selected"';
    142 }
    143 $default_comments_page .= '>' . __( 'last' ) . '</option><option value="oldest"';
    144 if ( 'oldest' === get_option( 'default_comments_page' ) ) {
    145         $default_comments_page .= ' selected="selected"';
    146 }
    147 $default_comments_page .= '>' . __( 'first' ) . '</option></select>';
    148 printf(
    149         /* translators: 1: Form field control for number of top level comments per page, 2: Form field control for the 'first' or 'last' page. */
    150         __( 'Break comments into pages with %1$s top level comments per page and the %2$s page displayed by default' ),
    151         '</label> <label for="comments_per_page"><input name="comments_per_page" type="number" step="1" min="0" id="comments_per_page" value="' . esc_attr( get_option( 'comments_per_page' ) ) . '" class="small-text" />',
    152         $default_comments_page
    153 );
    154150?>
    155 </label>
    156 <br />
    157 <label for="comment_order">
    158 <?php
    159 
    160 $comment_order = '<select name="comment_order" id="comment_order"><option value="asc"';
    161 if ( 'asc' === get_option( 'comment_order' ) ) {
    162         $comment_order .= ' selected="selected"';
    163 }
    164 $comment_order .= '>' . __( 'older' ) . '</option><option value="desc"';
    165 if ( 'desc' === get_option( 'comment_order' ) ) {
    166         $comment_order .= ' selected="selected"';
    167 }
    168 $comment_order .= '>' . __( 'newer' ) . '</option></select>';
    169 
    170 /* translators: %s: Form field control for 'older' or 'newer' comments. */
    171 printf( __( 'Comments should be displayed with the %s comments at the top of each page' ), $comment_order );
    172 
    173 ?>
    174 </label>
     151<ul>
     152        <li>
     153                <label for="comments_per_page"><?php _e( 'Top level comments per page' ); ?></label>
     154                <input name="comments_per_page" type="number" step="1" min="0" id="comments_per_page" value="<?php echo esc_attr( get_option( 'comments_per_page' ) ); ?>" class="small-text" />
     155        </li>
     156        <li>
     157                <label for="default_comments_page"><?php _e( 'Comments page to display by default' ); ?></label>
     158                <select name="default_comments_page" id="default_comments_page">
     159                        <option value="newest" <?php selected( 'newest', get_option( 'default_comments_page' ) ); ?>><?php _e( 'last page' ); ?></option>
     160                        <option value="oldest" <?php selected( 'oldest', get_option( 'default_comments_page' ) ); ?>><?php _e( 'first page' ); ?></option>
     161                </select>
     162        </li>
     163        <li>
     164                <label for="comment_order"><?php _e( 'Comments to display at the top of each page' ); ?></label>
     165                <select name="comment_order" id="comment_order">
     166                        <option value="asc" <?php selected( 'asc', get_option( 'comment_order' ) ); ?>><?php _e( 'older' ); ?></option>
     167                        <option value="desc" <?php selected( 'desc', get_option( 'comment_order' ) ); ?>><?php _e( 'newer' ); ?></option>
     168                </select>
     169        </li>
     170</ul>
    175171</fieldset></td>
    176172</tr>
     173
    177174<tr>
    178175<th scope="row"><?php _e( 'Email me whenever' ); ?></th>
    179176<td><fieldset><legend class="screen-reader-text"><span>
    printf( __( 'Comments should be displayed with the %s comments at the top of eac 
    186183<input name="comments_notify" type="checkbox" id="comments_notify" value="1" <?php checked( '1', get_option( 'comments_notify' ) ); ?> />
    187184<?php _e( 'Anyone posts a comment' ); ?> </label>
    188185<br />
     186
    189187<label for="moderation_notify">
    190188<input name="moderation_notify" type="checkbox" id="moderation_notify" value="1" <?php checked( '1', get_option( 'moderation_notify' ) ); ?> />
    191189<?php _e( 'A comment is held for moderation' ); ?> </label>
    printf( __( 'Comments should be displayed with the %s comments at the top of eac 
    203201<input name="comment_moderation" type="checkbox" id="comment_moderation" value="1" <?php checked( '1', get_option( 'comment_moderation' ) ); ?> />
    204202<?php _e( 'Comment must be manually approved' ); ?> </label>
    205203<br />
     204
    206205<label for="comment_previously_approved"><input type="checkbox" name="comment_previously_approved" id="comment_previously_approved" value="1" <?php checked( '1', get_option( 'comment_previously_approved' ) ); ?> /> <?php _e( 'Comment author must have a previously approved comment' ); ?></label>
    207206</fieldset></td>
    208207</tr>