Make WordPress Core


Ignore:
Timestamp:
10/21/2015 05:38:44 PM (11 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/includes/options.php

    r34022 r35337  
    140140    echo '<p class="description">' . __( 'The <a href="https://codex.wordpress.org/Glossary#Character_set">character encoding</a> of your site (UTF-8 is recommended)' ) . '</p>';
    141141}
     142
     143/**
     144 * Render the week starts on setting.
     145 *
     146 * @global WP_Locale $wp_locale
     147 *
     148 * @since 4.4.0
     149 */
     150function options_general_start_of_week() {
     151    global $wp_locale;
     152    ?>
     153    <select name="start_of_week" id="start_of_week">
     154        <?php
     155        $start_of_week = get_option( 'start_of_week' );
     156        for ( $day_index = 0; $day_index <= 6; $day_index++ ) {
     157            echo "\n\t<option value='" . esc_attr( $day_index ) . "'" . selected( $start_of_week, $day_index, false ) . ">" . $wp_locale->get_weekday( $day_index ) . '</option>';
     158        }
     159        ?>
     160    </select>
     161    <?php
     162}
Note: See TracChangeset for help on using the changeset viewer.