Hide upload_path and upload_url_path from the Media Settings screen, assuming they are both set to their default values.
These can be set on options.php, or the UPLOADS constant or the filters in wp_upload_dir() should be used. WordPress should aim to avoid UI options that require filesystem changes as well, not to mention requiring the user to convert between paths and URLs. fixes #21720. git-svn-id: http://core.svn.wordpress.org/trunk@21852 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
@@ -68,7 +68,6 @@ $whitelist_options = array(
|
||||
$whitelist_options['misc'] = $whitelist_options['options'] = $whitelist_options['privacy'] = array();
|
||||
|
||||
$mail_options = array('mailserver_url', 'mailserver_port', 'mailserver_login', 'mailserver_pass');
|
||||
$uploads_options = array('uploads_use_yearmonth_folders', 'upload_path', 'upload_url_path');
|
||||
|
||||
if ( ! in_array( get_option( 'blog_charset' ), array( 'utf8', 'utf-8', 'UTF8', 'UTF-8' ) ) )
|
||||
$whitelist_options['reading'][] = 'blog_charset';
|
||||
@@ -86,7 +85,13 @@ if ( !is_multisite() ) {
|
||||
$whitelist_options['writing'] = array_merge($whitelist_options['writing'], $mail_options);
|
||||
$whitelist_options['writing'][] = 'ping_sites';
|
||||
|
||||
$whitelist_options['media'] = array_merge($whitelist_options['media'], $uploads_options);
|
||||
$whitelist_options['media'][] = 'uploads_use_yearmonth_folders';
|
||||
|
||||
// If upload_url_path and upload_path are both default values, they're locked.
|
||||
if ( get_option( 'upload_url_path' ) || ( get_option('upload_path') != 'wp-content/uploads' && get_option('upload_path') ) ) {
|
||||
$whitelist_options['media'][] = 'upload_path';
|
||||
$whitelist_options['media'][] = 'upload_url_path';
|
||||
}
|
||||
} else {
|
||||
$whitelist_options['general'][] = 'new_admin_email';
|
||||
$whitelist_options['general'][] = 'WPLANG';
|
||||
|
||||
Reference in New Issue
Block a user