~canonical-sysadmins/wordpress/4.8.2

« back to all changes in this revision

Viewing changes to wp-admin/options-general.php

  • Committer: Barry Price
  • Date: 2017-06-09 02:09:58 UTC
  • mfrom: (1.1.26 upstream)
  • Revision ID: barry.price@canonical.com-20170609020958-838whhwt2196f2vk
Merge WP4.8 from upstream

Show diffs side-by-side

added added

removed removed

Lines of Context:
120
120
<?php endif; ?>
121
121
</td>
122
122
</tr>
123
 
<?php } ?>
 
123
<?php }
 
124
 
 
125
$languages = get_available_languages();
 
126
$translations = wp_get_available_translations();
 
127
if ( ! is_multisite() && defined( 'WPLANG' ) && '' !== WPLANG && 'en_US' !== WPLANG && ! in_array( WPLANG, $languages ) ) {
 
128
        $languages[] = WPLANG;
 
129
}
 
130
if ( ! empty( $languages ) || ! empty( $translations ) ) {
 
131
        ?>
 
132
        <tr>
 
133
                <th scope="row"><label for="WPLANG"><?php _e( 'Site Language' ); ?></label></th>
 
134
                <td>
 
135
                        <?php
 
136
                        $locale = get_locale();
 
137
                        if ( ! in_array( $locale, $languages ) ) {
 
138
                                $locale = '';
 
139
                        }
 
140
 
 
141
                        wp_dropdown_languages( array(
 
142
                                'name'         => 'WPLANG',
 
143
                                'id'           => 'WPLANG',
 
144
                                'selected'     => $locale,
 
145
                                'languages'    => $languages,
 
146
                                'translations' => $translations,
 
147
                                'show_available_translations' => ( ! is_multisite() || is_super_admin() ) && wp_can_install_language_pack(),
 
148
                        ) );
 
149
 
 
150
                        // Add note about deprecated WPLANG constant.
 
151
                        if ( defined( 'WPLANG' ) && ( '' !== WPLANG ) && $locale !== WPLANG ) {
 
152
                                if ( is_multisite() && current_user_can( 'manage_network_options' )
 
153
                                        || ! is_multisite() && current_user_can( 'manage_options' ) ) {
 
154
                                        ?>
 
155
                                        <p class="description">
 
156
                                                <strong><?php _e( 'Note:' ); ?></strong> <?php printf( __( 'The %s constant in your %s file is no longer needed.' ), '<code>WPLANG</code>', '<code>wp-config.php</code>' ); ?>
 
157
                                        </p>
 
158
                                        <?php
 
159
                                }
 
160
                                _deprecated_argument( 'define()', '4.0.0', sprintf( __( 'The %s constant in your %s file is no longer needed.' ), 'WPLANG', 'wp-config.php' ) );
 
161
                        }
 
162
                        ?>
 
163
                </td>
 
164
        </tr>
 
165
        <?php
 
166
}
 
167
?>
124
168
<tr>
125
169
<?php
126
170
$current_offset = get_option('gmt_offset');
253
297
 
254
298
        echo '<label><input type="radio" name="date_format" id="date_format_custom_radio" value="\c\u\s\t\o\m"';
255
299
        checked( $custom );
256
 
        echo '/> <span class="date-time-text date-time-custom-text">' . __( 'Custom:' ) . '<span class="screen-reader-text"> ' . __( 'enter a custom date format in the following field' ) . '</span></label>' .
 
300
        echo '/> <span class="date-time-text date-time-custom-text">' . __( 'Custom:' ) . '<span class="screen-reader-text"> ' . __( 'enter a custom date format in the following field' ) . '</span></span></label>' .
257
301
                '<label for="date_format_custom" class="screen-reader-text">' . __( 'Custom date format:' ) . '</label>' .
258
 
                '<input type="text" name="date_format_custom" id="date_format_custom" value="' . esc_attr( get_option( 'date_format' ) ) . '" class="small-text" /></span>' .
 
302
                '<input type="text" name="date_format_custom" id="date_format_custom" value="' . esc_attr( get_option( 'date_format' ) ) . '" class="small-text" />' .
259
303
                '<span class="screen-reader-text">' . __( 'example:' ) . ' </span> <span class="example">' . date_i18n( get_option( 'date_format' ) ) . '</span>' .
260
304
                "<span class='spinner'></span>\n";
261
305
?>
289
333
 
290
334
        echo '<label><input type="radio" name="time_format" id="time_format_custom_radio" value="\c\u\s\t\o\m"';
291
335
        checked( $custom );
292
 
        echo '/> <span class="date-time-text date-time-custom-text">' . __( 'Custom:' ) . '<span class="screen-reader-text"> ' . __( 'enter a custom time format in the following field' ) . '</span></label>' .
 
336
        echo '/> <span class="date-time-text date-time-custom-text">' . __( 'Custom:' ) . '<span class="screen-reader-text"> ' . __( 'enter a custom time format in the following field' ) . '</span></span></label>' .
293
337
                '<label for="time_format_custom" class="screen-reader-text">' . __( 'Custom time format:' ) . '</label>' .
294
 
                '<input type="text" name="time_format_custom" id="time_format_custom" value="' . esc_attr( get_option( 'time_format' ) ) . '" class="small-text" /></span>' .
 
338
                '<input type="text" name="time_format_custom" id="time_format_custom" value="' . esc_attr( get_option( 'time_format' ) ) . '" class="small-text" />' .
295
339
                '<span class="screen-reader-text">' . __( 'example:' ) . ' </span> <span class="example">' . date_i18n( get_option( 'time_format' ) ) . '</span>' .
296
340
                "<span class='spinner'></span>\n";
297
341
 
317
361
</select></td>
318
362
</tr>
319
363
<?php do_settings_fields('general', 'default'); ?>
320
 
 
321
 
<?php
322
 
$languages = get_available_languages();
323
 
$translations = wp_get_available_translations();
324
 
if ( ! is_multisite() && defined( 'WPLANG' ) && '' !== WPLANG && 'en_US' !== WPLANG && ! in_array( WPLANG, $languages ) ) {
325
 
        $languages[] = WPLANG;
326
 
}
327
 
if ( ! empty( $languages ) || ! empty( $translations ) ) {
328
 
        ?>
329
 
        <tr>
330
 
                <th width="33%" scope="row"><label for="WPLANG"><?php _e( 'Site Language' ); ?></label></th>
331
 
                <td>
332
 
                        <?php
333
 
                        $locale = get_locale();
334
 
                        if ( ! in_array( $locale, $languages ) ) {
335
 
                                $locale = '';
336
 
                        }
337
 
 
338
 
                        wp_dropdown_languages( array(
339
 
                                'name'         => 'WPLANG',
340
 
                                'id'           => 'WPLANG',
341
 
                                'selected'     => $locale,
342
 
                                'languages'    => $languages,
343
 
                                'translations' => $translations,
344
 
                                'show_available_translations' => ( ! is_multisite() || is_super_admin() ) && wp_can_install_language_pack(),
345
 
                        ) );
346
 
 
347
 
                        // Add note about deprecated WPLANG constant.
348
 
                        if ( defined( 'WPLANG' ) && ( '' !== WPLANG ) && $locale !== WPLANG ) {
349
 
                                if ( is_super_admin() ) {
350
 
                                        ?>
351
 
                                        <p class="description">
352
 
                                                <strong><?php _e( 'Note:' ); ?></strong> <?php printf( __( 'The %s constant in your %s file is no longer needed.' ), '<code>WPLANG</code>', '<code>wp-config.php</code>' ); ?>
353
 
                                        </p>
354
 
                                        <?php
355
 
                                }
356
 
                                _deprecated_argument( 'define()', '4.0.0', sprintf( __( 'The %s constant in your %s file is no longer needed.' ), 'WPLANG', 'wp-config.php' ) );
357
 
                        }
358
 
                        ?>
359
 
                </td>
360
 
        </tr>
361
 
        <?php
362
 
}
363
 
?>
364
364
</table>
365
365
 
366
366
<?php do_settings_sections('general'); ?>