WordPress.org

Make WordPress Core

Opened 20 months ago

Closed 17 months ago

Last modified 17 months ago

#21720 closed enhancement (fixed)

Hide upload_path and upload_url_path from the UI for new installs

Reported by: nacin Owned by: 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 20 months ago.
21720.diff (702 bytes) - added by nacin 17 months ago.
Untested.

Download all attachments as: .zip

Change History (12)

comment:1 wonderboymusic20 months 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.

comment:2 nacin20 months 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.

comment:3 scribu20 months ago

  • Cc scribu added

comment:4 ramiy17 months ago

Nacin, you forgot to clean the help tab.

nacin17 months ago

Untested.

comment:5 nacin17 months ago

  • Resolution fixed deleted
  • Status changed from closed to reopened

comment:6 trepmal17 months ago

works for me

comment:7 follow-up: ramiy17 months 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.

comment:8 in reply to: ↑ 7 helenyhou17 months 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.

comment:9 nacin17 months 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.

comment:10 nacin17 months 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.