Make WordPress Core

Ticket #28344: 28344.diff

File 28344.diff, 5.6 KB (added by swissspidy, 9 years ago)
  • src/wp-admin/includes/schema.php

    diff --git src/wp-admin/includes/schema.php src/wp-admin/includes/schema.php
    index 75e8f5b..ae5a4d5 100644
    function populate_options() { 
    385385        'blogdescription' => __('Just another WordPress site'),
    386386        'users_can_register' => 0,
    387387        'admin_email' => 'you@example.com',
    388         /* translators: default start of the week. 0 = Sunday, 1 = Monday */
    389         'start_of_week' => _x( '1', 'start of week' ),
    390388        'use_balanceTags' => 0,
    391389        'use_smilies' => 1,
    392390        'require_name_email' => 1,
  • src/wp-admin/options-general.php

    diff --git src/wp-admin/options-general.php src/wp-admin/options-general.php
    index cbb7d2f..726cb83 100644
    if ( $new_admin_email && $new_admin_email != get_option('admin_email') ) : ?> 
    167167</td>
    168168</tr>
    169169<?php } ?>
     170</table>
     171<h3 class="title"><?php _e( 'Locale' ); ?></h3>
     172<table class="form-table">
    170173<tr>
    171174<?php
    172175$current_offset = get_option('gmt_offset');
    if ( empty($tzstring) ) { // Create a UTC+- zone if no timezone string exists 
    317320        </fieldset>
    318321</td>
    319322</tr>
    320 <tr>
    321 <th scope="row"><label for="start_of_week"><?php _e('Week Starts On') ?></label></th>
    322 <td><select name="start_of_week" id="start_of_week">
    323 <?php
    324 /**
    325  * @global WP_Locale $wp_locale
    326  */
    327 global $wp_locale;
    328 
    329 for ($day_index = 0; $day_index <= 6; $day_index++) :
    330         $selected = (get_option('start_of_week') == $day_index) ? 'selected="selected"' : '';
    331         echo "\n\t<option value='" . esc_attr($day_index) . "' $selected>" . $wp_locale->get_weekday($day_index) . '</option>';
    332 endfor;
    333 ?>
    334 </select></td>
    335 </tr>
    336323<?php do_settings_fields('general', 'default'); ?>
    337324
    338325<?php
  • src/wp-admin/options.php

    diff --git src/wp-admin/options.php src/wp-admin/options.php
    index a4809cf..0f1be69 100644
    if ( is_multisite() && ! is_super_admin() && 'update' != $action ) { 
    8282}
    8383
    8484$whitelist_options = array(
    85         'general' => array( 'blogname', 'blogdescription', 'gmt_offset', 'date_format', 'time_format', 'start_of_week', 'timezone_string', 'WPLANG' ),
     85        'general' => array( 'blogname', 'blogdescription', 'gmt_offset', 'date_format', 'time_format', 'timezone_string', 'WPLANG' ),
    8686        'discussion' => array( 'default_pingback_flag', 'default_ping_status', 'default_comment_status', 'comments_notify', 'moderation_notify', 'comment_moderation', 'require_name_email', 'comment_whitelist', 'comment_max_links', 'moderation_keys', 'blacklist_keys', 'show_avatars', 'avatar_rating', 'avatar_default', 'close_comments_for_old_posts', 'close_comments_days_old', 'thread_comments', 'thread_comments_depth', 'page_comments', 'comments_per_page', 'default_comments_page', 'comment_order', 'comment_registration' ),
    8787        'media' => array( 'thumbnail_size_w', 'thumbnail_size_h', 'thumbnail_crop', 'medium_size_w', 'medium_size_h', 'large_size_w', 'large_size_h', 'image_default_size', 'image_default_align', 'image_default_link_type' ),
    8888        'reading' => array( 'posts_per_page', 'posts_per_rss', 'rss_use_excerpt', 'show_on_front', 'page_on_front', 'page_for_posts', 'blog_public' ),
  • src/wp-includes/default-filters.php

    diff --git src/wp-includes/default-filters.php src/wp-includes/default-filters.php
    index b6f0ce3..e7e45ad 100644
    add_action( 'wp_head', 'wp_post_preview_js', 1 ); 
    303303// Timezone
    304304add_filter( 'pre_option_gmt_offset','wp_timezone_override_offset' );
    305305
     306// Start of the week.
     307add_filter( 'pre_option_start_of_week','_wp_get_start_of_week' );
     308
    306309// Admin Color Schemes
    307310add_action( 'admin_init', 'register_admin_color_schemes', 1);
    308311add_action( 'admin_color_scheme_picker', 'admin_color_scheme_picker' );
    add_action( 'delete_attachment', '_delete_attachment_theme_mod' ); 
    346349// Calendar widget cache
    347350add_action( 'save_post', 'delete_get_calendar_cache' );
    348351add_action( 'delete_post', 'delete_get_calendar_cache' );
    349 add_action( 'update_option_start_of_week', 'delete_get_calendar_cache' );
    350352add_action( 'update_option_gmt_offset', 'delete_get_calendar_cache' );
    351353
    352354// Author
  • src/wp-includes/functions.php

    diff --git src/wp-includes/functions.php src/wp-includes/functions.php
    index 9206f9b..ca79ebf 100644
    function _mce_set_direction( $input ) { 
    29742974        return $input;
    29752975}
    29762976
     2977/**
     2978 * Retrieve the start of the week setting.
     2979 *
     2980 * @since 4.4.0
     2981 * @access private
     2982 *
     2983 * @global WP_Locale $wp_locale
     2984 *
     2985 * @param string $value The option value.
     2986 * @return int The start of the week set by the locale.
     2987 */
     2988function _wp_get_start_of_week( $value ) {
     2989        global $wp_locale;
     2990        return (int) $wp_locale->start_of_week;
     2991}
    29772992
    29782993/**
    29792994 * Convert smiley code to the icon graphic file equivalent.
  • src/wp-includes/locale.php

    diff --git src/wp-includes/locale.php src/wp-includes/locale.php
    index 1319c49..fdf1b91 100644
    class WP_Locale { 
    4242        public $weekday_abbrev;
    4343
    4444        /**
     45         * Stores the default start of the week.
     46         *
     47         * @var string
     48         */
     49        public $start_of_week;
     50
     51        /**
    4552         * Stores the translated strings for the full month names.
    4653         *
    4754         * @since 2.1.0
    class WP_Locale { 
    119126                        $this->weekday_initial[$weekday_] = preg_replace('/_.+_initial$/', '', $weekday_initial_);
    120127                }
    121128
     129                // Start of the week.
     130                $this->start_of_week = /* translators: default start of the week. 0 = Sunday, 1 = Monday */ _x( '1', 'start of week' );
     131
    122132                // Abbreviations for each day.
    123133                $this->weekday_abbrev[__('Sunday')]    = /* translators: three-letter abbreviation of the weekday */ __('Sun');
    124134                $this->weekday_abbrev[__('Monday')]    = /* translators: three-letter abbreviation of the weekday */ __('Mon');