Edit File by line
/home/zeestwma/ceyloniy.../wp-admin
File: options-general.php
<?php
[0] Fix | Delete
/**
[1] Fix | Delete
* General settings administration panel.
[2] Fix | Delete
*
[3] Fix | Delete
* @package WordPress
[4] Fix | Delete
* @subpackage Administration
[5] Fix | Delete
*/
[6] Fix | Delete
[7] Fix | Delete
/** WordPress Administration Bootstrap */
[8] Fix | Delete
require_once __DIR__ . '/admin.php';
[9] Fix | Delete
[10] Fix | Delete
/** WordPress Translation Installation API */
[11] Fix | Delete
require_once ABSPATH . 'wp-admin/includes/translation-install.php';
[12] Fix | Delete
[13] Fix | Delete
if ( ! current_user_can( 'manage_options' ) ) {
[14] Fix | Delete
wp_die( __( 'Sorry, you are not allowed to manage options for this site.' ) );
[15] Fix | Delete
}
[16] Fix | Delete
[17] Fix | Delete
// Used in the HTML title tag.
[18] Fix | Delete
$title = __( 'General Settings' );
[19] Fix | Delete
$parent_file = 'options-general.php';
[20] Fix | Delete
/* translators: Date and time format for exact current time, mainly about timezones, see https://www.php.net/manual/datetime.format.php */
[21] Fix | Delete
$timezone_format = _x( 'Y-m-d H:i:s', 'timezone date format' );
[22] Fix | Delete
[23] Fix | Delete
add_action( 'admin_head', 'options_general_add_js' );
[24] Fix | Delete
[25] Fix | Delete
$options_help = '<p>' . __( 'The fields on this screen determine some of the basics of your site setup.' ) . '</p>' .
[26] Fix | Delete
'<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>';
[27] Fix | Delete
[28] Fix | Delete
if ( ! is_multisite() ) {
[29] Fix | Delete
$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>' .
[30] Fix | Delete
'<p>' . sprintf(
[31] Fix | Delete
/* translators: %s: Documentation URL. */
[32] Fix | Delete
__( '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.' ),
[33] Fix | Delete
__( 'https://developer.wordpress.org/advanced-administration/server/wordpress-in-directory/' )
[34] Fix | Delete
) . '</p>' .
[35] Fix | Delete
'<p>' . sprintf(
[36] Fix | Delete
/* translators: 1: http://, 2: https:// */
[37] Fix | Delete
__( '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.' ),
[38] Fix | Delete
'<code>http://</code>',
[39] Fix | Delete
'<code>https://</code>'
[40] Fix | Delete
) . '</p>' .
[41] Fix | Delete
'<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>';
[42] Fix | Delete
}
[43] Fix | Delete
[44] Fix | Delete
$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>' .
[45] Fix | Delete
'<p>' . __( 'UTC means Coordinated Universal Time.' ) . '</p>' .
[46] Fix | Delete
'<p>' . __( 'You must click the Save Changes button at the bottom of the screen for new settings to take effect.' ) . '</p>';
[47] Fix | Delete
[48] Fix | Delete
get_current_screen()->add_help_tab(
[49] Fix | Delete
array(
[50] Fix | Delete
'id' => 'overview',
[51] Fix | Delete
'title' => __( 'Overview' ),
[52] Fix | Delete
'content' => $options_help,
[53] Fix | Delete
)
[54] Fix | Delete
);
[55] Fix | Delete
[56] Fix | Delete
get_current_screen()->set_help_sidebar(
[57] Fix | Delete
'<p><strong>' . __( 'For more information:' ) . '</strong></p>' .
[58] Fix | Delete
'<p>' . __( '<a href="https://wordpress.org/documentation/article/settings-general-screen/">Documentation on General Settings</a>' ) . '</p>' .
[59] Fix | Delete
'<p>' . __( '<a href="https://wordpress.org/support/forums/">Support forums</a>' ) . '</p>'
[60] Fix | Delete
);
[61] Fix | Delete
[62] Fix | Delete
require_once ABSPATH . 'wp-admin/admin-header.php';
[63] Fix | Delete
?>
[64] Fix | Delete
[65] Fix | Delete
<div class="wrap">
[66] Fix | Delete
<h1><?php echo esc_html( $title ); ?></h1>
[67] Fix | Delete
[68] Fix | Delete
<form method="post" action="options.php" novalidate="novalidate">
[69] Fix | Delete
<?php settings_fields( 'general' ); ?>
[70] Fix | Delete
[71] Fix | Delete
<table class="form-table" role="presentation">
[72] Fix | Delete
[73] Fix | Delete
<tr>
[74] Fix | Delete
<th scope="row"><label for="blogname"><?php _e( 'Site Title' ); ?></label></th>
[75] Fix | Delete
<td><input name="blogname" type="text" id="blogname" value="<?php form_option( 'blogname' ); ?>" class="regular-text" /></td>
[76] Fix | Delete
</tr>
[77] Fix | Delete
[78] Fix | Delete
<?php
[79] Fix | Delete
if ( ! is_multisite() ) {
[80] Fix | Delete
/* translators: Site tagline. */
[81] Fix | Delete
$sample_tagline = __( 'Just another WordPress site' );
[82] Fix | Delete
} else {
[83] Fix | Delete
/* translators: %s: Network title. */
[84] Fix | Delete
$sample_tagline = sprintf( __( 'Just another %s site' ), get_network()->site_name );
[85] Fix | Delete
}
[86] Fix | Delete
$tagline_description = sprintf(
[87] Fix | Delete
/* translators: %s: Site tagline example. */
[88] Fix | Delete
__( 'In a few words, explain what this site is about. Example: &#8220;%s.&#8221;' ),
[89] Fix | Delete
$sample_tagline
[90] Fix | Delete
);
[91] Fix | Delete
?>
[92] Fix | Delete
<tr>
[93] Fix | Delete
<th scope="row"><label for="blogdescription"><?php _e( 'Tagline' ); ?></label></th>
[94] Fix | Delete
<td><input name="blogdescription" type="text" id="blogdescription" aria-describedby="tagline-description" value="<?php form_option( 'blogdescription' ); ?>" class="regular-text" />
[95] Fix | Delete
<p class="description" id="tagline-description"><?php echo $tagline_description; ?></p></td>
[96] Fix | Delete
</tr>
[97] Fix | Delete
[98] Fix | Delete
<?php if ( current_user_can( 'upload_files' ) ) : ?>
[99] Fix | Delete
<tr class="hide-if-no-js site-icon-section">
[100] Fix | Delete
<th scope="row"><?php _e( 'Site Icon' ); ?></th>
[101] Fix | Delete
<td>
[102] Fix | Delete
<?php
[103] Fix | Delete
wp_enqueue_media();
[104] Fix | Delete
wp_enqueue_script( 'site-icon' );
[105] Fix | Delete
[106] Fix | Delete
$classes_for_upload_button = 'upload-button button-hero button';
[107] Fix | Delete
$classes_for_update_button = 'button';
[108] Fix | Delete
$classes_for_wrapper = '';
[109] Fix | Delete
[110] Fix | Delete
if ( has_site_icon() ) {
[111] Fix | Delete
$classes_for_wrapper .= ' has-site-icon';
[112] Fix | Delete
$classes_for_button = $classes_for_update_button;
[113] Fix | Delete
$classes_for_button_on_change = $classes_for_upload_button;
[114] Fix | Delete
} else {
[115] Fix | Delete
$classes_for_wrapper .= ' hidden';
[116] Fix | Delete
$classes_for_button = $classes_for_upload_button;
[117] Fix | Delete
$classes_for_button_on_change = $classes_for_update_button;
[118] Fix | Delete
}
[119] Fix | Delete
[120] Fix | Delete
// Handle alt text for site icon on page load.
[121] Fix | Delete
$site_icon_id = (int) get_option( 'site_icon' );
[122] Fix | Delete
$app_icon_alt_value = '';
[123] Fix | Delete
$browser_icon_alt_value = '';
[124] Fix | Delete
[125] Fix | Delete
$site_icon_url = get_site_icon_url();
[126] Fix | Delete
[127] Fix | Delete
if ( $site_icon_id ) {
[128] Fix | Delete
$img_alt = get_post_meta( $site_icon_id, '_wp_attachment_image_alt', true );
[129] Fix | Delete
$filename = wp_basename( $site_icon_url );
[130] Fix | Delete
$app_icon_alt_value = sprintf(
[131] Fix | Delete
/* translators: %s: The selected image filename. */
[132] Fix | Delete
__( 'App icon preview: The current image has no alternative text. The file name is: %s' ),
[133] Fix | Delete
$filename
[134] Fix | Delete
);
[135] Fix | Delete
[136] Fix | Delete
$browser_icon_alt_value = sprintf(
[137] Fix | Delete
/* translators: %s: The selected image filename. */
[138] Fix | Delete
__( 'Browser icon preview: The current image has no alternative text. The file name is: %s' ),
[139] Fix | Delete
$filename
[140] Fix | Delete
);
[141] Fix | Delete
[142] Fix | Delete
if ( $img_alt ) {
[143] Fix | Delete
$app_icon_alt_value = sprintf(
[144] Fix | Delete
/* translators: %s: The selected image alt text. */
[145] Fix | Delete
__( 'App icon preview: Current image: %s' ),
[146] Fix | Delete
$img_alt
[147] Fix | Delete
);
[148] Fix | Delete
[149] Fix | Delete
$browser_icon_alt_value = sprintf(
[150] Fix | Delete
/* translators: %s: The selected image alt text. */
[151] Fix | Delete
__( 'Browser icon preview: Current image: %s' ),
[152] Fix | Delete
$img_alt
[153] Fix | Delete
);
[154] Fix | Delete
}
[155] Fix | Delete
}
[156] Fix | Delete
?>
[157] Fix | Delete
[158] Fix | Delete
<style>
[159] Fix | Delete
:root {
[160] Fix | Delete
--site-icon-url: url( '<?php echo esc_url( $site_icon_url ); ?>' );
[161] Fix | Delete
}
[162] Fix | Delete
</style>
[163] Fix | Delete
[164] Fix | Delete
<div id="site-icon-preview" class="site-icon-preview settings <?php echo esc_attr( $classes_for_wrapper ); ?>">
[165] Fix | Delete
<div class="direction-wrap">
[166] Fix | Delete
<img id="app-icon-preview" src="<?php echo esc_url( $site_icon_url ); ?>" class="app-icon-preview" alt="<?php echo esc_attr( $app_icon_alt_value ); ?>" />
[167] Fix | Delete
<div class="site-icon-preview-browser">
[168] Fix | Delete
<svg role="img" aria-hidden="true" fill="none" xmlns="http://www.w3.org/2000/svg" class="browser-buttons"><path fill-rule="evenodd" clip-rule="evenodd" d="M0 20a6 6 0 1 1 12 0 6 6 0 0 1-12 0Zm18 0a6 6 0 1 1 12 0 6 6 0 0 1-12 0Zm24-6a6 6 0 1 0 0 12 6 6 0 0 0 0-12Z" /></svg>
[169] Fix | Delete
<div class="site-icon-preview-tab">
[170] Fix | Delete
<img id="browser-icon-preview" src="<?php echo esc_url( $site_icon_url ); ?>" class="browser-icon-preview" alt="<?php echo esc_attr( $browser_icon_alt_value ); ?>" />
[171] Fix | Delete
<div class="site-icon-preview-site-title" id="site-icon-preview-site-title" aria-hidden="true"><?php bloginfo( 'name' ); ?></div>
[172] Fix | Delete
<svg role="img" aria-hidden="true" fill="none" xmlns="http://www.w3.org/2000/svg" class="close-button">
[173] Fix | Delete
<path d="M12 13.0607L15.7123 16.773L16.773 15.7123L13.0607 12L16.773 8.28772L15.7123 7.22706L12 10.9394L8.28771 7.22705L7.22705 8.28771L10.9394 12L7.22706 15.7123L8.28772 16.773L12 13.0607Z" />
[174] Fix | Delete
</svg>
[175] Fix | Delete
</div>
[176] Fix | Delete
</div>
[177] Fix | Delete
</div>
[178] Fix | Delete
</div>
[179] Fix | Delete
</div>
[180] Fix | Delete
[181] Fix | Delete
<input type="hidden" name="site_icon" id="site_icon_hidden_field" value="<?php form_option( 'site_icon' ); ?>" />
[182] Fix | Delete
<div class="site-icon-action-buttons">
[183] Fix | Delete
<button type="button"
[184] Fix | Delete
id="choose-from-library-button"
[185] Fix | Delete
class="<?php echo esc_attr( $classes_for_button ); ?>"
[186] Fix | Delete
data-alt-classes="<?php echo esc_attr( $classes_for_button_on_change ); ?>"
[187] Fix | Delete
data-size="512"
[188] Fix | Delete
data-choose-text="<?php esc_attr_e( 'Choose a Site Icon' ); ?>"
[189] Fix | Delete
data-update-text="<?php esc_attr_e( 'Change Site Icon' ); ?>"
[190] Fix | Delete
data-update="<?php esc_attr_e( 'Set as Site Icon' ); ?>"
[191] Fix | Delete
data-state="<?php echo esc_attr( has_site_icon() ); ?>"
[192] Fix | Delete
[193] Fix | Delete
>
[194] Fix | Delete
<?php if ( has_site_icon() ) : ?>
[195] Fix | Delete
<?php _e( 'Change Site Icon' ); ?>
[196] Fix | Delete
<?php else : ?>
[197] Fix | Delete
<?php _e( 'Choose a Site Icon' ); ?>
[198] Fix | Delete
<?php endif; ?>
[199] Fix | Delete
</button>
[200] Fix | Delete
<button
[201] Fix | Delete
id="js-remove-site-icon"
[202] Fix | Delete
type="button"
[203] Fix | Delete
<?php echo has_site_icon() ? 'class="button button-secondary reset remove-site-icon"' : 'class="button button-secondary reset hidden"'; ?>
[204] Fix | Delete
>
[205] Fix | Delete
<?php _e( 'Remove Site Icon' ); ?>
[206] Fix | Delete
</button>
[207] Fix | Delete
</div>
[208] Fix | Delete
[209] Fix | Delete
<p class="description">
[210] Fix | Delete
<?php
[211] Fix | Delete
printf(
[212] Fix | Delete
/* translators: 1: pixel value for icon size. 2: pixel value for icon size. */
[213] Fix | Delete
__( '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 <code>%1$s by %2$s</code> pixels.' ),
[214] Fix | Delete
512,
[215] Fix | Delete
512
[216] Fix | Delete
);
[217] Fix | Delete
?>
[218] Fix | Delete
</p>
[219] Fix | Delete
[220] Fix | Delete
</td>
[221] Fix | Delete
</tr>
[222] Fix | Delete
[223] Fix | Delete
<?php
[224] Fix | Delete
endif;
[225] Fix | Delete
/* End Site Icon */
[226] Fix | Delete
[227] Fix | Delete
if ( ! is_multisite() ) {
[228] Fix | Delete
$wp_site_url_class = '';
[229] Fix | Delete
$wp_home_class = '';
[230] Fix | Delete
if ( defined( 'WP_SITEURL' ) ) {
[231] Fix | Delete
$wp_site_url_class = ' disabled';
[232] Fix | Delete
}
[233] Fix | Delete
if ( defined( 'WP_HOME' ) ) {
[234] Fix | Delete
$wp_home_class = ' disabled';
[235] Fix | Delete
}
[236] Fix | Delete
?>
[237] Fix | Delete
[238] Fix | Delete
<tr>
[239] Fix | Delete
<th scope="row"><label for="siteurl"><?php _e( 'WordPress Address (URL)' ); ?></label></th>
[240] Fix | Delete
<td><input name="siteurl" type="url" id="siteurl" value="<?php form_option( 'siteurl' ); ?>"<?php disabled( defined( 'WP_SITEURL' ) ); ?> class="regular-text code<?php echo $wp_site_url_class; ?>" /></td>
[241] Fix | Delete
</tr>
[242] Fix | Delete
[243] Fix | Delete
<tr>
[244] Fix | Delete
<th scope="row"><label for="home"><?php _e( 'Site Address (URL)' ); ?></label></th>
[245] Fix | Delete
<td><input name="home" type="url" id="home" aria-describedby="home-description" value="<?php form_option( 'home' ); ?>"<?php disabled( defined( 'WP_HOME' ) ); ?> class="regular-text code<?php echo $wp_home_class; ?>" />
[246] Fix | Delete
<?php if ( ! defined( 'WP_HOME' ) ) : ?>
[247] Fix | Delete
<p class="description" id="home-description">
[248] Fix | Delete
<?php
[249] Fix | Delete
printf(
[250] Fix | Delete
/* translators: %s: Documentation URL. */
[251] Fix | Delete
__( 'Enter the same address here unless you <a href="%s">want your site home page to be different from your WordPress installation directory</a>.' ),
[252] Fix | Delete
__( 'https://developer.wordpress.org/advanced-administration/server/wordpress-in-directory/' )
[253] Fix | Delete
);
[254] Fix | Delete
?>
[255] Fix | Delete
</p>
[256] Fix | Delete
<?php endif; ?>
[257] Fix | Delete
</td>
[258] Fix | Delete
</tr>
[259] Fix | Delete
[260] Fix | Delete
<?php } ?>
[261] Fix | Delete
[262] Fix | Delete
<tr>
[263] Fix | Delete
<th scope="row"><label for="new_admin_email"><?php _e( 'Administration Email Address' ); ?></label></th>
[264] Fix | Delete
<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" />
[265] Fix | Delete
<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>
[266] Fix | Delete
<?php
[267] Fix | Delete
$new_admin_email = get_option( 'new_admin_email' );
[268] Fix | Delete
if ( $new_admin_email && get_option( 'admin_email' ) !== $new_admin_email ) {
[269] Fix | Delete
$pending_admin_email_message = sprintf(
[270] Fix | Delete
/* translators: %s: New admin email. */
[271] Fix | Delete
__( 'There is a pending change of the admin email to %s.' ),
[272] Fix | Delete
'<code>' . esc_html( $new_admin_email ) . '</code>'
[273] Fix | Delete
);
[274] Fix | Delete
$pending_admin_email_message .= sprintf(
[275] Fix | Delete
' <a href="%1$s">%2$s</a>',
[276] Fix | Delete
esc_url( wp_nonce_url( admin_url( 'options.php?dismiss=new_admin_email' ), 'dismiss-' . get_current_blog_id() . '-new_admin_email' ) ),
[277] Fix | Delete
__( 'Cancel' )
[278] Fix | Delete
);
[279] Fix | Delete
wp_admin_notice(
[280] Fix | Delete
$pending_admin_email_message,
[281] Fix | Delete
array(
[282] Fix | Delete
'additional_classes' => array( 'updated', 'inline' ),
[283] Fix | Delete
)
[284] Fix | Delete
);
[285] Fix | Delete
}
[286] Fix | Delete
?>
[287] Fix | Delete
</td>
[288] Fix | Delete
</tr>
[289] Fix | Delete
[290] Fix | Delete
<?php
[291] Fix | Delete
if ( ! is_multisite() ) {
[292] Fix | Delete
$membership_title = __( 'Membership' );
[293] Fix | Delete
?>
[294] Fix | Delete
<tr>
[295] Fix | Delete
<th scope="row"><?php echo $membership_title; ?></th>
[296] Fix | Delete
<td><fieldset><legend class="screen-reader-text"><span><?php echo $membership_title; ?></span></legend><label for="users_can_register">
[297] Fix | Delete
<input name="users_can_register" type="checkbox" id="users_can_register" value="1" <?php checked( '1', get_option( 'users_can_register' ) ); ?> />
[298] Fix | Delete
<?php _e( 'Anyone can register' ); ?></label>
[299] Fix | Delete
</fieldset></td>
[300] Fix | Delete
</tr>
[301] Fix | Delete
[302] Fix | Delete
<tr>
[303] Fix | Delete
<th scope="row"><label for="default_role"><?php _e( 'New User Default Role' ); ?></label></th>
[304] Fix | Delete
<td>
[305] Fix | Delete
<select name="default_role" id="default_role"><?php wp_dropdown_roles( get_option( 'default_role' ) ); ?></select>
[306] Fix | Delete
</td>
[307] Fix | Delete
</tr>
[308] Fix | Delete
[309] Fix | Delete
<?php
[310] Fix | Delete
}
[311] Fix | Delete
[312] Fix | Delete
$languages = get_available_languages();
[313] Fix | Delete
$translations = wp_get_available_translations();
[314] Fix | Delete
if ( ! is_multisite() && defined( 'WPLANG' ) && '' !== WPLANG && 'en_US' !== WPLANG && ! in_array( WPLANG, $languages, true ) ) {
[315] Fix | Delete
$languages[] = WPLANG;
[316] Fix | Delete
}
[317] Fix | Delete
if ( ! empty( $languages ) || ! empty( $translations ) ) {
[318] Fix | Delete
?>
[319] Fix | Delete
<tr>
[320] Fix | Delete
<th scope="row"><label for="WPLANG"><?php _e( 'Site Language' ); ?><span class="dashicons dashicons-translation" aria-hidden="true"></span></label></th>
[321] Fix | Delete
<td>
[322] Fix | Delete
<?php
[323] Fix | Delete
$locale = get_locale();
[324] Fix | Delete
if ( ! in_array( $locale, $languages, true ) ) {
[325] Fix | Delete
$locale = '';
[326] Fix | Delete
}
[327] Fix | Delete
[328] Fix | Delete
wp_dropdown_languages(
[329] Fix | Delete
array(
[330] Fix | Delete
'name' => 'WPLANG',
[331] Fix | Delete
'id' => 'WPLANG',
[332] Fix | Delete
'selected' => $locale,
[333] Fix | Delete
'languages' => $languages,
[334] Fix | Delete
'translations' => $translations,
[335] Fix | Delete
'show_available_translations' => current_user_can( 'install_languages' ) && wp_can_install_language_pack(),
[336] Fix | Delete
)
[337] Fix | Delete
);
[338] Fix | Delete
[339] Fix | Delete
// Add note about deprecated WPLANG constant.
[340] Fix | Delete
if ( defined( 'WPLANG' ) && ( '' !== WPLANG ) && WPLANG !== $locale ) {
[341] Fix | Delete
_deprecated_argument(
[342] Fix | Delete
'define()',
[343] Fix | Delete
'4.0.0',
[344] Fix | Delete
/* translators: 1: WPLANG, 2: wp-config.php */
[345] Fix | Delete
sprintf( __( 'The %1$s constant in your %2$s file is no longer needed.' ), 'WPLANG', 'wp-config.php' )
[346] Fix | Delete
);
[347] Fix | Delete
}
[348] Fix | Delete
?>
[349] Fix | Delete
</td>
[350] Fix | Delete
</tr>
[351] Fix | Delete
<?php
[352] Fix | Delete
}
[353] Fix | Delete
?>
[354] Fix | Delete
<tr>
[355] Fix | Delete
<?php
[356] Fix | Delete
$current_offset = get_option( 'gmt_offset' );
[357] Fix | Delete
$tzstring = get_option( 'timezone_string' );
[358] Fix | Delete
[359] Fix | Delete
$check_zone_info = true;
[360] Fix | Delete
[361] Fix | Delete
// Remove old Etc mappings. Fallback to gmt_offset.
[362] Fix | Delete
if ( str_contains( $tzstring, 'Etc/GMT' ) ) {
[363] Fix | Delete
$tzstring = '';
[364] Fix | Delete
}
[365] Fix | Delete
[366] Fix | Delete
if ( empty( $tzstring ) ) { // Create a UTC+- zone if no timezone string exists.
[367] Fix | Delete
$check_zone_info = false;
[368] Fix | Delete
if ( 0 === (int) $current_offset ) {
[369] Fix | Delete
$tzstring = 'UTC+0';
[370] Fix | Delete
} elseif ( $current_offset < 0 ) {
[371] Fix | Delete
$tzstring = 'UTC' . $current_offset;
[372] Fix | Delete
} else {
[373] Fix | Delete
$tzstring = 'UTC+' . $current_offset;
[374] Fix | Delete
}
[375] Fix | Delete
}
[376] Fix | Delete
[377] Fix | Delete
?>
[378] Fix | Delete
<th scope="row"><label for="timezone_string"><?php _e( 'Timezone' ); ?></label></th>
[379] Fix | Delete
<td>
[380] Fix | Delete
[381] Fix | Delete
<select id="timezone_string" name="timezone_string" aria-describedby="timezone-description">
[382] Fix | Delete
<?php echo wp_timezone_choice( $tzstring, get_user_locale() ); ?>
[383] Fix | Delete
</select>
[384] Fix | Delete
[385] Fix | Delete
<p class="description" id="timezone-description">
[386] Fix | Delete
<?php
[387] Fix | Delete
printf(
[388] Fix | Delete
/* translators: %s: UTC abbreviation */
[389] Fix | Delete
__( 'Choose either a city in the same timezone as you or a %s (Coordinated Universal Time) time offset.' ),
[390] Fix | Delete
'<abbr>UTC</abbr>'
[391] Fix | Delete
);
[392] Fix | Delete
?>
[393] Fix | Delete
</p>
[394] Fix | Delete
[395] Fix | Delete
<p class="timezone-info">
[396] Fix | Delete
<span id="utc-time">
[397] Fix | Delete
<?php
[398] Fix | Delete
printf(
[399] Fix | Delete
/* translators: %s: UTC time. */
[400] Fix | Delete
__( 'Universal time is %s.' ),
[401] Fix | Delete
'<code>' . date_i18n( $timezone_format, false, true ) . '</code>'
[402] Fix | Delete
);
[403] Fix | Delete
?>
[404] Fix | Delete
</span>
[405] Fix | Delete
<?php if ( get_option( 'timezone_string' ) || ! empty( $current_offset ) ) : ?>
[406] Fix | Delete
<span id="local-time">
[407] Fix | Delete
<?php
[408] Fix | Delete
printf(
[409] Fix | Delete
/* translators: %s: Local time. */
[410] Fix | Delete
__( 'Local time is %s.' ),
[411] Fix | Delete
'<code>' . date_i18n( $timezone_format ) . '</code>'
[412] Fix | Delete
);
[413] Fix | Delete
?>
[414] Fix | Delete
</span>
[415] Fix | Delete
<?php endif; ?>
[416] Fix | Delete
</p>
[417] Fix | Delete
[418] Fix | Delete
<?php if ( $check_zone_info && $tzstring ) : ?>
[419] Fix | Delete
<p class="timezone-info">
[420] Fix | Delete
<span>
[421] Fix | Delete
<?php
[422] Fix | Delete
$now = new DateTime( 'now', new DateTimeZone( $tzstring ) );
[423] Fix | Delete
$dst = (bool) $now->format( 'I' );
[424] Fix | Delete
[425] Fix | Delete
if ( $dst ) {
[426] Fix | Delete
_e( 'This timezone is currently in daylight saving time.' );
[427] Fix | Delete
} else {
[428] Fix | Delete
_e( 'This timezone is currently in standard time.' );
[429] Fix | Delete
}
[430] Fix | Delete
?>
[431] Fix | Delete
<br />
[432] Fix | Delete
<?php
[433] Fix | Delete
if ( in_array( $tzstring, timezone_identifiers_list( DateTimeZone::ALL_WITH_BC ), true ) ) {
[434] Fix | Delete
$transitions = timezone_transitions_get( timezone_open( $tzstring ), time() );
[435] Fix | Delete
[436] Fix | Delete
// 0 index is the state at current time, 1 index is the next transition, if any.
[437] Fix | Delete
if ( ! empty( $transitions[1] ) ) {
[438] Fix | Delete
echo ' ';
[439] Fix | Delete
$message = $transitions[1]['isdst'] ?
[440] Fix | Delete
/* translators: %s: Date and time. */
[441] Fix | Delete
__( 'Daylight saving time begins on: %s.' ) :
[442] Fix | Delete
/* translators: %s: Date and time. */
[443] Fix | Delete
__( 'Standard time begins on: %s.' );
[444] Fix | Delete
printf(
[445] Fix | Delete
$message,
[446] Fix | Delete
/* translators: Localized date and time format, see https://www.php.net/manual/datetime.format.php */
[447] Fix | Delete
'<code>' . wp_date( __( 'F j, Y g:i a' ), $transitions[1]['ts'] ) . '</code>'
[448] Fix | Delete
);
[449] Fix | Delete
} else {
[450] Fix | Delete
_e( 'This timezone does not observe daylight saving time.' );
[451] Fix | Delete
}
[452] Fix | Delete
}
[453] Fix | Delete
?>
[454] Fix | Delete
</span>
[455] Fix | Delete
</p>
[456] Fix | Delete
<?php endif; ?>
[457] Fix | Delete
</td>
[458] Fix | Delete
</tr>
[459] Fix | Delete
[460] Fix | Delete
<?php $date_format_title = __( 'Date Format' ); ?>
[461] Fix | Delete
<tr>
[462] Fix | Delete
<th scope="row"><?php echo $date_format_title; ?></th>
[463] Fix | Delete
<td>
[464] Fix | Delete
<fieldset><legend class="screen-reader-text"><span><?php echo $date_format_title; ?></span></legend>
[465] Fix | Delete
<?php
[466] Fix | Delete
/**
[467] Fix | Delete
* Filters the default date formats.
[468] Fix | Delete
*
[469] Fix | Delete
* @since 2.7.0
[470] Fix | Delete
* @since 4.0.0 Replaced the `Y/m/d` format with `Y-m-d` (ISO date standard YYYY-MM-DD).
[471] Fix | Delete
* @since 6.8.0 Added the `d.m.Y` format.
[472] Fix | Delete
*
[473] Fix | Delete
* @param string[] $default_date_formats Array of default date formats.
[474] Fix | Delete
*/
[475] Fix | Delete
$date_formats = array_unique( apply_filters( 'date_formats', array( __( 'F j, Y' ), 'Y-m-d', 'm/d/Y', 'd/m/Y', 'd.m.Y' ) ) );
[476] Fix | Delete
[477] Fix | Delete
$custom = true;
[478] Fix | Delete
[479] Fix | Delete
foreach ( $date_formats as $format ) {
[480] Fix | Delete
echo "\t<label><input type='radio' name='date_format' value='" . esc_attr( $format ) . "'";
[481] Fix | Delete
if ( get_option( 'date_format' ) === $format ) { // checked() uses "==" rather than "===".
[482] Fix | Delete
echo " checked='checked'";
[483] Fix | Delete
$custom = false;
[484] Fix | Delete
}
[485] Fix | Delete
echo ' /> <span class="date-time-text format-i18n">' . date_i18n( $format ) . '</span><code>' . esc_html( $format ) . "</code></label><br />\n";
[486] Fix | Delete
}
[487] Fix | Delete
[488] Fix | Delete
echo '<label><input type="radio" name="date_format" id="date_format_custom_radio" value="\c\u\s\t\o\m"';
[489] Fix | Delete
checked( $custom );
[490] Fix | Delete
echo '/> <span class="date-time-text date-time-custom-text">' . __( 'Custom:' ) . '<span class="screen-reader-text"> ' .
[491] Fix | Delete
/* translators: Hidden accessibility text. */
[492] Fix | Delete
__( 'enter a custom date format in the following field' ) .
[493] Fix | Delete
'</span></span></label>' .
[494] Fix | Delete
'<label for="date_format_custom" class="screen-reader-text">' .
[495] Fix | Delete
/* translators: Hidden accessibility text. */
[496] Fix | Delete
__( 'Custom date format:' ) .
[497] Fix | Delete
'</label>' .
[498] Fix | Delete
'<input type="text" name="date_format_custom" id="date_format_custom" value="' . esc_attr( get_option( 'date_format' ) ) . '" class="small-text" />' .
[499] Fix | Delete
12
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function