Merged in feature/81-dev-dev01 (pull request #5)
auto-patch 81-dev-dev01-2023-12-05T22_45_26 * auto-patch 81-dev-dev01-2023-12-05T22_45_26
This commit is contained in:
@@ -279,6 +279,23 @@ if ( 'update' === $action ) { // We are saving settings sent from a settings pag
|
||||
$_POST['gmt_offset'] = $_POST['timezone_string'];
|
||||
$_POST['gmt_offset'] = preg_replace( '/UTC\+?/', '', $_POST['gmt_offset'] );
|
||||
$_POST['timezone_string'] = '';
|
||||
} elseif ( isset( $_POST['timezone_string'] ) && ! in_array( $_POST['timezone_string'], timezone_identifiers_list( DateTimeZone::ALL_WITH_BC ), true ) ) {
|
||||
// Reset to the current value.
|
||||
$current_timezone_string = get_option( 'timezone_string' );
|
||||
|
||||
if ( ! empty( $current_timezone_string ) ) {
|
||||
$_POST['timezone_string'] = $current_timezone_string;
|
||||
} else {
|
||||
$_POST['gmt_offset'] = get_option( 'gmt_offset' );
|
||||
$_POST['timezone_string'] = '';
|
||||
}
|
||||
|
||||
add_settings_error(
|
||||
'general',
|
||||
'settings_updated',
|
||||
__( 'The timezone you have entered is not valid. Please select a valid timezone.' ),
|
||||
'error'
|
||||
);
|
||||
}
|
||||
|
||||
// Handle translation installation.
|
||||
@@ -359,10 +376,14 @@ require_once ABSPATH . 'wp-admin/admin-header.php';
|
||||
<div class="wrap">
|
||||
<h1><?php esc_html_e( 'All Settings' ); ?></h1>
|
||||
|
||||
<div class="notice notice-warning">
|
||||
<p><strong><?php _e( 'Warning:' ); ?></strong> <?php _e( 'This page allows direct access to your site settings. You can break things here. Please be cautious!' ); ?></p>
|
||||
</div>
|
||||
|
||||
<?php
|
||||
wp_admin_notice(
|
||||
'<strong>' . __( 'Warning:' ) . '</strong> ' . __( 'This page allows direct access to your site settings. You can break things here. Please be cautious!' ),
|
||||
array(
|
||||
'type' => 'warning',
|
||||
)
|
||||
);
|
||||
?>
|
||||
<form name="form" action="options.php" method="post" id="all-options">
|
||||
<?php wp_nonce_field( 'options-options' ); ?>
|
||||
<input type="hidden" name="action" value="update" />
|
||||
|
||||
Reference in New Issue
Block a user