summaryrefslogtreecommitdiffstats
path: root/wp-admin/options.php
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--wp-admin/options.php16
1 files changed, 10 insertions, 6 deletions
diff --git a/wp-admin/options.php b/wp-admin/options.php
index 33779a7..6916e2e 100644
--- a/wp-admin/options.php
+++ b/wp-admin/options.php
@@ -23,7 +23,8 @@ $title = __( 'Settings' );
$this_file = 'options.php';
$parent_file = 'options-general.php';
-wp_reset_vars( array( 'action', 'option_page' ) );
+$action = ! empty( $_REQUEST['action'] ) ? sanitize_text_field( $_REQUEST['action'] ) : '';
+$option_page = ! empty( $_REQUEST['option_page'] ) ? sanitize_text_field( $_REQUEST['option_page'] ) : '';
$capability = 'manage_options';
@@ -159,7 +160,7 @@ $allowed_options['privacy'] = array();
$mail_options = array( 'mailserver_url', 'mailserver_port', 'mailserver_login', 'mailserver_pass' );
-if ( ! in_array( get_option( 'blog_charset' ), array( 'utf8', 'utf-8', 'UTF8', 'UTF-8' ), true ) ) {
+if ( ! is_utf8_charset() ) {
$allowed_options['reading'][] = 'blog_charset';
}
@@ -180,7 +181,9 @@ if ( ! is_multisite() ) {
$allowed_options['general'][] = 'default_role';
$allowed_options['writing'] = array_merge( $allowed_options['writing'], $mail_options );
- $allowed_options['writing'][] = 'ping_sites';
+ if ( '1' === get_option( 'blog_public' ) ) {
+ $allowed_options['writing'][] = 'ping_sites';
+ }
$allowed_options['media'][] = 'uploads_use_yearmonth_folders';
@@ -321,9 +324,10 @@ if ( 'update' === $action ) { // We are saving settings sent from a settings pag
'options.php',
'2.7.0',
sprintf(
- /* translators: %s: The option/setting. */
- __( 'The %s setting is unregistered. Unregistered settings are deprecated. See https://developer.wordpress.org/plugins/settings/settings-api/' ),
- '<code>' . esc_html( $option ) . '</code>'
+ /* translators: 1: The option/setting, 2: Documentation URL. */
+ __( 'The %1$s setting is unregistered. Unregistered settings are deprecated. See <a href="%2$s">documentation on the Settings API</a>.' ),
+ '<code>' . esc_html( $option ) . '</code>',
+ __( 'https://developer.wordpress.org/plugins/settings/settings-api/' )
)
);
}