Make WordPress Core


Ignore:
Timestamp:
10/21/2015 05:38:44 PM (10 years ago)
Author:
ocean90
Message:

Options: Hide the week starts on setting for installs that have the default setting already.

The default setting is the value of $wp_locale->start_of_week which holds the value per locale, see [35336].

Props swissspidy, ocean90.
Fixes #28344.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/options-general.php

    r34300 r35337  
    5454
    5555<form method="post" action="options.php" novalidate="novalidate">
    56 <?php settings_fields('general'); ?>
     56<?php
     57settings_fields( 'general' );
     58
     59/**
     60 * @global WP_Locale $wp_locale
     61 */
     62global $wp_locale;
     63if ( get_option( 'start_of_week' ) != $wp_locale->start_of_week ) {
     64    add_settings_field( 'start_of_week', __( 'Week Starts On' ), 'options_general_start_of_week', 'general', 'default', array( 'label_for' => 'start_of_week' ) );
     65}
     66?>
    5767
    5868<table class="form-table">
     
    275285</td>
    276286</tr>
    277 <tr>
    278 <th scope="row"><label for="start_of_week"><?php _e('Week Starts On') ?></label></th>
    279 <td><select name="start_of_week" id="start_of_week">
    280 <?php
    281 /**
    282  * @global WP_Locale $wp_locale
    283  */
    284 global $wp_locale;
    285 
    286 for ($day_index = 0; $day_index <= 6; $day_index++) :
    287     $selected = (get_option('start_of_week') == $day_index) ? 'selected="selected"' : '';
    288     echo "\n\t<option value='" . esc_attr($day_index) . "' $selected>" . $wp_locale->get_weekday($day_index) . '</option>';
    289 endfor;
    290 ?>
    291 </select></td>
    292 </tr>
    293 <?php do_settings_fields('general', 'default'); ?>
     287
     288<?php do_settings_fields( 'general', 'default' ); ?>
    294289
    295290<?php
Note: See TracChangeset for help on using the changeset viewer.