Make WordPress Core

Ticket #28344: 28344.3.diff

File 28344.3.diff, 6.3 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 dd36834..fa77ae2 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,
    function populate_options() { 
    558556                'can_compress_scripts', 'page_uris', 'update_core', 'update_plugins', 'update_themes', 'doing_cron',
    559557                'random_seed', 'rss_excerpt_length', 'secret', 'use_linksupdate', 'default_comment_status_page',
    560558                'wporg_popular_tags', 'what_to_show', 'rss_language', 'language', 'enable_xmlrpc', 'enable_app',
    561                 'embed_autourls', 'default_post_edit_rows',
     559                'embed_autourls', 'default_post_edit_rows', 'start_of_week',
    562560        );
    563561        foreach ( $unusedoptions as $option )
    564562                delete_option($option);
  • src/wp-admin/options-general.php

    diff --git src/wp-admin/options-general.php src/wp-admin/options-general.php
    index 662184a..e07eca5 100644
    if ( $new_admin_email && $new_admin_email != get_option('admin_email') ) : ?> 
    114114</td>
    115115</tr>
    116116<?php } ?>
     117</table>
     118<h3 class="title"><?php _e( 'Locale' ); ?></h3>
     119<table class="form-table">
    117120<tr>
    118121<?php
    119122$current_offset = get_option('gmt_offset');
    if ( empty($tzstring) ) { // Create a UTC+- zone if no timezone string exists 
    274277        </fieldset>
    275278</td>
    276279</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>
    293280<?php do_settings_fields('general', 'default'); ?>
    294281
    295282<?php
  • src/wp-admin/options.php

    diff --git src/wp-admin/options.php src/wp-admin/options.php
    index 6bad0fd..d5d5acf 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 e9ddc47..9fdd320 100644
    add_action( 'wp_head', 'wp_post_preview_js', 1 ); 
    305305// Timezone
    306306add_filter( 'pre_option_gmt_offset','wp_timezone_override_offset' );
    307307
     308// Start of the week.
     309add_filter( 'default_option_start_of_week', '_wp_get_start_of_week' );
     310
    308311// Admin Color Schemes
    309312add_action( 'admin_init', 'register_admin_color_schemes', 1);
    310313add_action( 'admin_color_scheme_picker', 'admin_color_scheme_picker' );
    add_action( 'delete_attachment', '_delete_attachment_theme_mod' ); 
    355358// Calendar widget cache
    356359add_action( 'save_post', 'delete_get_calendar_cache' );
    357360add_action( 'delete_post', 'delete_get_calendar_cache' );
    358 add_action( 'update_option_start_of_week', 'delete_get_calendar_cache' );
    359361add_action( 'update_option_gmt_offset', 'delete_get_calendar_cache' );
    360362
    361363// Author
  • src/wp-includes/functions.php

    diff --git src/wp-includes/functions.php src/wp-includes/functions.php
    index a275023..750220f 100644
    function _mce_set_direction( $input ) { 
    29282928        return $input;
    29292929}
    29302930
     2931/**
     2932 * Retrieve the start of the week setting.
     2933 *
     2934 * @since 4.4.0
     2935 * @access private
     2936 *
     2937 * @global WP_Locale $wp_locale
     2938 *
     2939 * @param string $value The option value.
     2940 * @return int The start of the week set by the locale.
     2941 */
     2942function _wp_get_start_of_week( $value ) {
     2943        global $wp_locale;
     2944        return (int) $wp_locale->start_of_week;
     2945}
    29312946
    29322947/**
    29332948 * 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 ded3378..1776144 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 { 
    114121                $this->weekday_initial[ __( 'Friday' ) ]    = /* translators: one-letter abbreviation of the weekday */ _x( 'F', 'Friday initial' );
    115122                $this->weekday_initial[ __( 'Saturday' ) ]  = /* translators: one-letter abbreviation of the weekday */ _x( 'S', 'Saturday initial' );
    116123
     124                // Start of the week.
     125                $this->start_of_week = /* translators: default start of the week. 0 = Sunday, 1 = Monday */ _x( '0', 'start of week' );
     126
    117127                // Abbreviations for each day.
    118128                $this->weekday_abbrev[__('Sunday')]    = /* translators: three-letter abbreviation of the weekday */ __('Sun');
    119129                $this->weekday_abbrev[__('Monday')]    = /* translators: three-letter abbreviation of the weekday */ __('Mon');