23 $timezone_format = _x( 'Y-m-d H:i:s', 'timezone date format' ); |
23 $timezone_format = _x( 'Y-m-d H:i:s', 'timezone date format' ); |
24 |
24 |
25 add_action( 'admin_head', 'options_general_add_js' ); |
25 add_action( 'admin_head', 'options_general_add_js' ); |
26 |
26 |
27 $options_help = '<p>' . __( 'The fields on this screen determine some of the basics of your site setup.' ) . '</p>' . |
27 $options_help = '<p>' . __( 'The fields on this screen determine some of the basics of your site setup.' ) . '</p>' . |
28 '<p>' . __( 'Most themes display the site title at the top of every page, in the title bar of the browser, and as the identifying name for syndicated feeds. The tagline is also displayed by many themes.' ) . '</p>'; |
28 '<p>' . __( 'Most themes show the site title at the top of every page, in the title bar of the browser, and as the identifying name for syndicated feeds. Many themes also show the tagline.' ) . '</p>'; |
29 |
29 |
30 if ( ! is_multisite() ) { |
30 if ( ! is_multisite() ) { |
31 $options_help .= '<p>' . __( 'The WordPress URL and the site URL can be the same (example.com) or different; for example, having the WordPress core files (example.com/wordpress) in a subdirectory instead of the root directory.' ) . '</p>' . |
31 $options_help .= '<p>' . __( 'Two terms you will want to know are the WordPress URL and the site URL. The WordPress URL is where the core WordPress installation files are, and the site URL is the address a visitor uses in the browser to go to your site.' ) . '</p>' . |
32 '<p>' . __( 'If you want site visitors to be able to register themselves, as opposed to by the site administrator, check the membership box. A default user role can be set for all new users, whether self-registered or registered by the site admin.' ) . '</p>'; |
32 '<p>' . sprintf( |
33 } |
33 /* translators: %s: Documentation URL. */ |
34 |
34 __( 'Though the terms refer to two different concepts, in practice, they can be the same address or different. For example, you can have the core WordPress installation files in the root directory (<code>https://example.com</code>), in which case the two URLs would be the same. Or the <a href="%s">WordPress files can be in a subdirectory</a> (<code>https://example.com/wordpress</code>). In that case, the WordPress URL and the site URL would be different.' ), |
35 $options_help .= '<p>' . __( 'You can set the language, and the translation files will be automatically downloaded and installed (available if your filesystem is writable).' ) . '</p>' . |
35 __( 'https://developer.wordpress.org/advanced-administration/server/wordpress-in-directory/' ) |
|
36 ) . '</p>' . |
|
37 '<p>' . sprintf( |
|
38 /* translators: 1: http://, 2: https:// */ |
|
39 __( 'Both WordPress URL and site URL can start with either %1$s or %2$s. A URL starting with %2$s requires an SSL certificate, so be sure that you have one before changing to %2$s. With %2$s, a padlock will appear next to the address in the browser address bar. Both %2$s and the padlock signal that your site meets some basic security requirements, which can build trust with your visitors and with search engines.' ), |
|
40 '<code>http://</code>', |
|
41 '<code>https://</code>' |
|
42 ) . '</p>' . |
|
43 '<p>' . __( 'If you want site visitors to be able to register themselves, check the membership box. If you want the site administrator to register every new user, leave the box unchecked. In either case, you can set a default user role for all new users.' ) . '</p>'; |
|
44 } |
|
45 |
|
46 $options_help .= '<p>' . __( 'You can set the language, and WordPress will automatically download and install the translation files (available if your filesystem is writable).' ) . '</p>' . |
36 '<p>' . __( 'UTC means Coordinated Universal Time.' ) . '</p>' . |
47 '<p>' . __( 'UTC means Coordinated Universal Time.' ) . '</p>' . |
37 '<p>' . __( 'You must click the Save Changes button at the bottom of the screen for new settings to take effect.' ) . '</p>'; |
48 '<p>' . __( 'You must click the Save Changes button at the bottom of the screen for new settings to take effect.' ) . '</p>'; |
38 |
49 |
39 get_current_screen()->add_help_tab( |
50 get_current_screen()->add_help_tab( |
40 array( |
51 array( |
64 <tr> |
75 <tr> |
65 <th scope="row"><label for="blogname"><?php _e( 'Site Title' ); ?></label></th> |
76 <th scope="row"><label for="blogname"><?php _e( 'Site Title' ); ?></label></th> |
66 <td><input name="blogname" type="text" id="blogname" value="<?php form_option( 'blogname' ); ?>" class="regular-text" /></td> |
77 <td><input name="blogname" type="text" id="blogname" value="<?php form_option( 'blogname' ); ?>" class="regular-text" /></td> |
67 </tr> |
78 </tr> |
68 |
79 |
|
80 <?php |
|
81 if ( ! is_multisite() ) { |
|
82 /* translators: Site tagline. */ |
|
83 $sample_tagline = __( 'Just another WordPress site' ); |
|
84 } else { |
|
85 /* translators: %s: Network title. */ |
|
86 $sample_tagline = sprintf( __( 'Just another %s site' ), get_network()->site_name ); |
|
87 } |
|
88 $tagline_description = sprintf( |
|
89 /* translators: %s: Site tagline example. */ |
|
90 __( 'In a few words, explain what this site is about. Example: “%s.”' ), |
|
91 $sample_tagline |
|
92 ); |
|
93 ?> |
69 <tr> |
94 <tr> |
70 <th scope="row"><label for="blogdescription"><?php _e( 'Tagline' ); ?></label></th> |
95 <th scope="row"><label for="blogdescription"><?php _e( 'Tagline' ); ?></label></th> |
71 <td><input name="blogdescription" type="text" id="blogdescription" aria-describedby="tagline-description" value="<?php form_option( 'blogdescription' ); ?>" class="regular-text" /> |
96 <td><input name="blogdescription" type="text" id="blogdescription" aria-describedby="tagline-description" value="<?php form_option( 'blogdescription' ); ?>" class="regular-text" /> |
72 <p class="description" id="tagline-description"><?php _e( 'In a few words, explain what this site is about.' ); ?></p></td> |
97 <p class="description" id="tagline-description"><?php echo $tagline_description; ?></p></td> |
73 </tr> |
98 </tr> |
74 |
99 |
75 <?php |
100 <?php if ( current_user_can( 'upload_files' ) ) : ?> |
|
101 <tr class="hide-if-no-js site-icon-section"> |
|
102 <th scope="row"><?php _e( 'Site Icon' ); ?></th> |
|
103 <td> |
|
104 <?php |
|
105 wp_enqueue_media(); |
|
106 wp_enqueue_script( 'site-icon' ); |
|
107 |
|
108 $classes_for_upload_button = 'upload-button button-add-media button-add-site-icon'; |
|
109 $classes_for_update_button = 'button'; |
|
110 $classes_for_wrapper = ''; |
|
111 |
|
112 if ( has_site_icon() ) { |
|
113 $classes_for_wrapper .= ' has-site-icon'; |
|
114 $classes_for_button = $classes_for_update_button; |
|
115 $classes_for_button_on_change = $classes_for_upload_button; |
|
116 } else { |
|
117 $classes_for_wrapper .= ' hidden'; |
|
118 $classes_for_button = $classes_for_upload_button; |
|
119 $classes_for_button_on_change = $classes_for_update_button; |
|
120 } |
|
121 |
|
122 // Handle alt text for site icon on page load. |
|
123 $site_icon_id = (int) get_option( 'site_icon' ); |
|
124 $app_icon_alt_value = ''; |
|
125 $browser_icon_alt_value = ''; |
|
126 |
|
127 if ( $site_icon_id ) { |
|
128 $img_alt = get_post_meta( $site_icon_id, '_wp_attachment_image_alt', true ); |
|
129 $filename = wp_basename( get_site_icon_url() ); |
|
130 $app_icon_alt_value = sprintf( |
|
131 /* translators: %s: The selected image filename. */ |
|
132 __( 'App icon preview: The current image has no alternative text. The file name is: %s' ), |
|
133 $filename |
|
134 ); |
|
135 |
|
136 $browser_icon_alt_value = sprintf( |
|
137 /* translators: %s: The selected image filename. */ |
|
138 __( 'Browser icon preview: The current image has no alternative text. The file name is: %s' ), |
|
139 $filename |
|
140 ); |
|
141 |
|
142 if ( $img_alt ) { |
|
143 $app_icon_alt_value = sprintf( |
|
144 /* translators: %s: The selected image alt text. */ |
|
145 __( 'App icon preview: Current image: %s' ), |
|
146 $img_alt |
|
147 ); |
|
148 |
|
149 $browser_icon_alt_value = sprintf( |
|
150 /* translators: %s: The selected image alt text. */ |
|
151 __( 'Browser icon preview: Current image: %s' ), |
|
152 $img_alt |
|
153 ); |
|
154 } |
|
155 } |
|
156 ?> |
|
157 |
|
158 |
|
159 <div id="site-icon-preview" class="site-icon-preview wp-clearfix settings-page-preview <?php echo esc_attr( $classes_for_wrapper ); ?>"> |
|
160 <div class="favicon-preview"> |
|
161 <img src="<?php echo esc_url( admin_url( 'images/' . ( is_rtl() ? 'browser-rtl.png' : 'browser.png' ) ) ); ?>" class="browser-preview" width="182" alt=""> |
|
162 <div class="favicon"> |
|
163 <img id="browser-icon-preview" src="<?php site_icon_url(); ?>" alt="<?php echo esc_attr( $browser_icon_alt_value ); ?>"> |
|
164 </div> |
|
165 <span id="site-icon-preview-site-title" class="browser-title" aria-hidden="true"><?php bloginfo( 'name' ); ?></span> |
|
166 </div> |
|
167 <img id="app-icon-preview" class="app-icon-preview" src="<?php site_icon_url(); ?>" alt="<?php echo esc_attr( $app_icon_alt_value ); ?>"> |
|
168 </div> |
|
169 |
|
170 <input type="hidden" name="site_icon" id="site_icon_hidden_field" value="<?php form_option( 'site_icon' ); ?>" /> |
|
171 <div class="action-buttons"> |
|
172 <button type="button" |
|
173 id="choose-from-library-button" |
|
174 type="button" |
|
175 class="<?php echo esc_attr( $classes_for_button ); ?>" |
|
176 data-alt-classes="<?php echo esc_attr( $classes_for_button_on_change ); ?>" |
|
177 data-size="512" |
|
178 data-choose-text="<?php esc_attr_e( 'Choose a Site Icon' ); ?>" |
|
179 data-update-text="<?php esc_attr_e( 'Change Site Icon' ); ?>" |
|
180 data-update="<?php esc_attr_e( 'Set as Site Icon' ); ?>" |
|
181 data-state="<?php echo esc_attr( has_site_icon() ); ?>" |
|
182 |
|
183 > |
|
184 <?php if ( has_site_icon() ) : ?> |
|
185 <?php _e( 'Change Site Icon' ); ?> |
|
186 <?php else : ?> |
|
187 <?php _e( 'Choose a Site Icon' ); ?> |
|
188 <?php endif; ?> |
|
189 </button> |
|
190 <button |
|
191 id="js-remove-site-icon" |
|
192 type="button" |
|
193 <?php echo has_site_icon() ? 'class="button button-secondary reset"' : 'class="button button-secondary reset hidden"'; ?> |
|
194 > |
|
195 <?php _e( 'Remove Site Icon' ); ?> |
|
196 </button> |
|
197 </div> |
|
198 |
|
199 <p class="description"> |
|
200 <?php |
|
201 /* translators: %s: Site Icon size in pixels. */ |
|
202 printf( __( 'The Site Icon is what you see in browser tabs, bookmark bars, and within the WordPress mobile apps. It should be square and at least %s pixels.' ), '<code>512 × 512</code>' ); |
|
203 ?> |
|
204 </p> |
|
205 |
|
206 </td> |
|
207 </tr> |
|
208 |
|
209 <?php |
|
210 endif; |
|
211 /* End Site Icon */ |
|
212 |
76 if ( ! is_multisite() ) { |
213 if ( ! is_multisite() ) { |
77 $wp_site_url_class = ''; |
214 $wp_site_url_class = ''; |
78 $wp_home_class = ''; |
215 $wp_home_class = ''; |
79 if ( defined( 'WP_SITEURL' ) ) { |
216 if ( defined( 'WP_SITEURL' ) ) { |
80 $wp_site_url_class = ' disabled'; |
217 $wp_site_url_class = ' disabled'; |
112 <th scope="row"><label for="new_admin_email"><?php _e( 'Administration Email Address' ); ?></label></th> |
249 <th scope="row"><label for="new_admin_email"><?php _e( 'Administration Email Address' ); ?></label></th> |
113 <td><input name="new_admin_email" type="email" id="new_admin_email" aria-describedby="new-admin-email-description" value="<?php form_option( 'admin_email' ); ?>" class="regular-text ltr" /> |
250 <td><input name="new_admin_email" type="email" id="new_admin_email" aria-describedby="new-admin-email-description" value="<?php form_option( 'admin_email' ); ?>" class="regular-text ltr" /> |
114 <p class="description" id="new-admin-email-description"><?php _e( 'This address is used for admin purposes. If you change this, an email will be sent to your new address to confirm it. <strong>The new address will not become active until confirmed.</strong>' ); ?></p> |
251 <p class="description" id="new-admin-email-description"><?php _e( 'This address is used for admin purposes. If you change this, an email will be sent to your new address to confirm it. <strong>The new address will not become active until confirmed.</strong>' ); ?></p> |
115 <?php |
252 <?php |
116 $new_admin_email = get_option( 'new_admin_email' ); |
253 $new_admin_email = get_option( 'new_admin_email' ); |
117 if ( $new_admin_email && get_option( 'admin_email' ) !== $new_admin_email ) : |
254 if ( $new_admin_email && get_option( 'admin_email' ) !== $new_admin_email ) { |
118 ?> |
255 $pending_admin_email_message = sprintf( |
119 <div class="updated inline"> |
256 /* translators: %s: New admin email. */ |
120 <p> |
257 __( 'There is a pending change of the admin email to %s.' ), |
121 <?php |
258 '<code>' . esc_html( $new_admin_email ) . '</code>' |
122 printf( |
259 ); |
123 /* translators: %s: New admin email. */ |
260 $pending_admin_email_message .= sprintf( |
124 __( 'There is a pending change of the admin email to %s.' ), |
261 ' <a href="%1$s">%2$s</a>', |
125 '<code>' . esc_html( $new_admin_email ) . '</code>' |
262 esc_url( wp_nonce_url( admin_url( 'options.php?dismiss=new_admin_email' ), 'dismiss-' . get_current_blog_id() . '-new_admin_email' ) ), |
126 ); |
263 __( 'Cancel' ) |
127 printf( |
264 ); |
128 ' <a href="%1$s">%2$s</a>', |
265 wp_admin_notice( |
129 esc_url( wp_nonce_url( admin_url( 'options.php?dismiss=new_admin_email' ), 'dismiss-' . get_current_blog_id() . '-new_admin_email' ) ), |
266 $pending_admin_email_message, |
130 __( 'Cancel' ) |
267 array( |
131 ); |
268 'additional_classes' => array( 'updated', 'inline' ), |
132 ?> |
269 ) |
133 </p> |
270 ); |
134 </div> |
271 } |
135 <?php endif; ?> |
272 ?> |
136 </td> |
273 </td> |
137 </tr> |
274 </tr> |
138 |
275 |
139 <?php if ( ! is_multisite() ) { ?> |
276 <?php if ( ! is_multisite() ) { ?> |
140 |
277 |
141 <tr> |
278 <tr> |
142 <th scope="row"><?php _e( 'Membership' ); ?></th> |
279 <th scope="row"><?php _e( 'Membership' ); ?></th> |
143 <td> <fieldset><legend class="screen-reader-text"><span><?php _e( 'Membership' ); ?></span></legend><label for="users_can_register"> |
280 <td> <fieldset><legend class="screen-reader-text"><span> |
|
281 <?php |
|
282 /* translators: Hidden accessibility text. */ |
|
283 _e( 'Membership' ); |
|
284 ?> |
|
285 </span></legend><label for="users_can_register"> |
144 <input name="users_can_register" type="checkbox" id="users_can_register" value="1" <?php checked( '1', get_option( 'users_can_register' ) ); ?> /> |
286 <input name="users_can_register" type="checkbox" id="users_can_register" value="1" <?php checked( '1', get_option( 'users_can_register' ) ); ?> /> |
145 <?php _e( 'Anyone can register' ); ?></label> |
287 <?php _e( 'Anyone can register' ); ?></label> |
146 </fieldset></td> |
288 </fieldset></td> |
147 </tr> |
289 </tr> |
148 |
290 |
204 $tzstring = get_option( 'timezone_string' ); |
346 $tzstring = get_option( 'timezone_string' ); |
205 |
347 |
206 $check_zone_info = true; |
348 $check_zone_info = true; |
207 |
349 |
208 // Remove old Etc mappings. Fallback to gmt_offset. |
350 // Remove old Etc mappings. Fallback to gmt_offset. |
209 if ( false !== strpos( $tzstring, 'Etc/GMT' ) ) { |
351 if ( str_contains( $tzstring, 'Etc/GMT' ) ) { |
210 $tzstring = ''; |
352 $tzstring = ''; |
211 } |
353 } |
212 |
354 |
213 if ( empty( $tzstring ) ) { // Create a UTC+- zone if no timezone string exists. |
355 if ( empty( $tzstring ) ) { // Create a UTC+- zone if no timezone string exists. |
214 $check_zone_info = false; |
356 $check_zone_info = false; |
215 if ( 0 == $current_offset ) { |
357 if ( 0 === (int) $current_offset ) { |
216 $tzstring = 'UTC+0'; |
358 $tzstring = 'UTC+0'; |
217 } elseif ( $current_offset < 0 ) { |
359 } elseif ( $current_offset < 0 ) { |
218 $tzstring = 'UTC' . $current_offset; |
360 $tzstring = 'UTC' . $current_offset; |
219 } else { |
361 } else { |
220 $tzstring = 'UTC+' . $current_offset; |
362 $tzstring = 'UTC+' . $current_offset; |
329 echo ' /> <span class="date-time-text format-i18n">' . date_i18n( $format ) . '</span><code>' . esc_html( $format ) . "</code></label><br />\n"; |
476 echo ' /> <span class="date-time-text format-i18n">' . date_i18n( $format ) . '</span><code>' . esc_html( $format ) . "</code></label><br />\n"; |
330 } |
477 } |
331 |
478 |
332 echo '<label><input type="radio" name="date_format" id="date_format_custom_radio" value="\c\u\s\t\o\m"'; |
479 echo '<label><input type="radio" name="date_format" id="date_format_custom_radio" value="\c\u\s\t\o\m"'; |
333 checked( $custom ); |
480 checked( $custom ); |
334 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>' . |
481 echo '/> <span class="date-time-text date-time-custom-text">' . __( 'Custom:' ) . '<span class="screen-reader-text"> ' . |
335 '<label for="date_format_custom" class="screen-reader-text">' . __( 'Custom date format:' ) . '</label>' . |
482 /* translators: Hidden accessibility text. */ |
|
483 __( 'enter a custom date format in the following field' ) . |
|
484 '</span></span></label>' . |
|
485 '<label for="date_format_custom" class="screen-reader-text">' . |
|
486 /* translators: Hidden accessibility text. */ |
|
487 __( 'Custom date format:' ) . |
|
488 '</label>' . |
336 '<input type="text" name="date_format_custom" id="date_format_custom" value="' . esc_attr( get_option( 'date_format' ) ) . '" class="small-text" />' . |
489 '<input type="text" name="date_format_custom" id="date_format_custom" value="' . esc_attr( get_option( 'date_format' ) ) . '" class="small-text" />' . |
337 '<br />' . |
490 '<br />' . |
338 '<p><strong>' . __( 'Preview:' ) . '</strong> <span class="example">' . date_i18n( get_option( 'date_format' ) ) . '</span>' . |
491 '<p><strong>' . __( 'Preview:' ) . '</strong> <span class="example">' . date_i18n( get_option( 'date_format' ) ) . '</span>' . |
339 "<span class='spinner'></span>\n" . '</p>'; |
492 "<span class='spinner'></span>\n" . '</p>'; |
340 ?> |
493 ?> |
366 echo ' /> <span class="date-time-text format-i18n">' . date_i18n( $format ) . '</span><code>' . esc_html( $format ) . "</code></label><br />\n"; |
524 echo ' /> <span class="date-time-text format-i18n">' . date_i18n( $format ) . '</span><code>' . esc_html( $format ) . "</code></label><br />\n"; |
367 } |
525 } |
368 |
526 |
369 echo '<label><input type="radio" name="time_format" id="time_format_custom_radio" value="\c\u\s\t\o\m"'; |
527 echo '<label><input type="radio" name="time_format" id="time_format_custom_radio" value="\c\u\s\t\o\m"'; |
370 checked( $custom ); |
528 checked( $custom ); |
371 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>' . |
529 echo '/> <span class="date-time-text date-time-custom-text">' . __( 'Custom:' ) . '<span class="screen-reader-text"> ' . |
372 '<label for="time_format_custom" class="screen-reader-text">' . __( 'Custom time format:' ) . '</label>' . |
530 /* translators: Hidden accessibility text. */ |
|
531 __( 'enter a custom time format in the following field' ) . |
|
532 '</span></span></label>' . |
|
533 '<label for="time_format_custom" class="screen-reader-text">' . |
|
534 /* translators: Hidden accessibility text. */ |
|
535 __( 'Custom time format:' ) . |
|
536 '</label>' . |
373 '<input type="text" name="time_format_custom" id="time_format_custom" value="' . esc_attr( get_option( 'time_format' ) ) . '" class="small-text" />' . |
537 '<input type="text" name="time_format_custom" id="time_format_custom" value="' . esc_attr( get_option( 'time_format' ) ) . '" class="small-text" />' . |
374 '<br />' . |
538 '<br />' . |
375 '<p><strong>' . __( 'Preview:' ) . '</strong> <span class="example">' . date_i18n( get_option( 'time_format' ) ) . '</span>' . |
539 '<p><strong>' . __( 'Preview:' ) . '</strong> <span class="example">' . date_i18n( get_option( 'time_format' ) ) . '</span>' . |
376 "<span class='spinner'></span>\n" . '</p>'; |
540 "<span class='spinner'></span>\n" . '</p>'; |
377 |
541 |
378 echo "\t<p class='date-time-doc'>" . __( '<a href="https://wordpress.org/support/article/formatting-date-and-time/">Documentation on date and time formatting</a>.' ) . "</p>\n"; |
542 echo "\t<p class='date-time-doc'>" . __( '<a href="https://wordpress.org/documentation/article/customize-date-and-time-format/">Documentation on date and time formatting</a>.' ) . "</p>\n"; |
379 ?> |
543 ?> |
380 </fieldset> |
544 </fieldset> |
381 </td> |
545 </td> |
382 </tr> |
546 </tr> |
383 <tr> |
547 <tr> |