Make WordPress Core

Opened 12 years ago

Closed 12 years ago

Last modified 12 years ago

#21720 closed enhancement (fixed)

Hide upload_path and upload_url_path from the UI for new installs

Reported by: nacin's profile nacin Owned by: nacin's profile nacin
Milestone: 3.5 Priority: normal
Severity: normal Version:
Component: Media Keywords: has-patch
Focuses: Cc:

Description

Changing the upload_path and upload_url_path options are pretty dangerous. They have the potential to break quite a bit of things, not to mention they have the potential of simply not working.

In #19235, I was able to simplify wp_upload_dir() so the UPLOADS constant would again be 100% reliable. If you wanted to specify the exact location of your uploads dir, this is how you should do it, the same way you can move wp-content and other directories.

There's really no good reason to show upload_path or upload_url_path in the UI unless the values are other than the default (wp-content/uploads or '' for upload_path, and '' for upload_url_path). With that, most of a section disappears, leaving just year/month folder organization.

Attachments (2)

upload-dirs-display-only.diff (1.6 KB) - added by wonderboymusic 12 years ago.
21720.diff (702 bytes) - added by nacin 12 years ago.
Untested.

Download all attachments as: .zip

Change History (12)

#1 @wonderboymusic
12 years ago

  • Keywords has-patch added

I took a stab at display-only - now shows you the real value of wp_upload_dir() 'path' and 'url' - so the screen would be a way to debug when your code is changing those values.

#2 @nacin
12 years ago

  • Owner set to nacin
  • Resolution set to fixed
  • Status changed from new to closed

In [21852]:

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.

#3 @scribu
12 years ago

  • Cc scribu added

#4 @ramiy
12 years ago

Nacin, you forgot to clean the help tab.

@nacin
12 years ago

Untested.

#5 @nacin
12 years ago

  • Resolution fixed deleted
  • Status changed from closed to reopened

#6 @trepmal
12 years ago

works for me

#7 follow-up: @ramiy
12 years ago

There were a few changes on settings pages, i think you need to audit all the settings "help tabs" to hide (or remove) unnecessary text.

#8 in reply to: ↑ 7 @helenyhou
12 years ago

Replying to ramiy:

There were a few changes on settings pages, i think you need to audit all the settings "help tabs" to hide (or remove) unnecessary text.

See #22451 for all the hard work others have already put into reviewing help text. You are welcome to do so as well.

#9 @nacin
12 years ago

  • Resolution set to fixed
  • Status changed from reopened to closed

In 23134:

Only show help for upload_path and upload_url_path if those fields are visible. fixes #21720.

#10 @nacin
12 years ago

In 23137:

Only show help for upload_path and upload_url_path if those fields are visible. fixes #21720.

Merges [23134] to the 3.5 branch.

Note: See TracTickets for help on using tickets.