Make WordPress Core


Ignore:
Timestamp:
09/14/2012 09:00:39 PM (11 years ago)
Author:
nacin
Message:

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.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin/options.php

    r21849 r21852  
    6969
    7070$mail_options = array('mailserver_url', 'mailserver_port', 'mailserver_login', 'mailserver_pass');
    71 $uploads_options = array('uploads_use_yearmonth_folders', 'upload_path', 'upload_url_path');
    7271
    7372if ( ! in_array( get_option( 'blog_charset' ), array( 'utf8', 'utf-8', 'UTF8', 'UTF-8' ) ) )
     
    8786    $whitelist_options['writing'][] = 'ping_sites';
    8887
    89     $whitelist_options['media'] = array_merge($whitelist_options['media'], $uploads_options);
     88    $whitelist_options['media'][] = 'uploads_use_yearmonth_folders';
     89
     90    // If upload_url_path and upload_path are both default values, they're locked.
     91    if ( get_option( 'upload_url_path' ) || ( get_option('upload_path') != 'wp-content/uploads' && get_option('upload_path') ) ) {
     92        $whitelist_options['media'][] = 'upload_path';
     93        $whitelist_options['media'][] = 'upload_url_path';
     94    }
    9095} else {
    9196    $whitelist_options['general'][] = 'new_admin_email';
Note: See TracChangeset for help on using the changeset viewer.