WordPress.org

Make WordPress Core

Opened 5 years ago

Closed 10 months ago

#9409 closed enhancement (worksforme)

Mandatory setting for variable uploads_use_yearmonth_folders

Reported by: hspaans Owned by:
Milestone: Priority: normal
Severity: normal Version:
Component: Upload Keywords:
Focuses: Cc:

Description

The reasoning behing this patch is to make WordPress shared hosting friendly by using a shared codebase and mandatory settings.

This patch overrules database parameter "uploads_use_yearmonth_folders" and removes the interface option when the following constant is set in wp-config.php:

define('WP_UPLOADS_USE_YEARMONTH_FOLDERS', false);
define('WP_UPLOADS_USE_YEARMONTH_FOLDERS', true);

Attachments (1)

wordpress-2.7.1-hspaans-1.patch (1.3 KB) - added by hspaans 5 years ago.

Download all attachments as: .zip

Change History (7)

comment:1 hspaans5 years ago

  • Keywords has-patch added

comment:2 Denis-de-Bernardy5 years ago

  • Keywords mandatory upload structure removed
  • Milestone Unassigned deleted
  • Resolution set to invalid
  • Status changed from new to closed

why not use WPMU?

comment:3 hspaans5 years ago

WPMU doesn't work that well in a shared codebase environment and doesn't meet the requirements.

comment:4 Denis-de-Bernardy5 years ago

oh, in that case, use the WP_CONTENT_DIR and the WP_PLUGINS_DIR urls. should do the trick. you get one content dir for all sites and a shared plugins_dir, which is what I assume you want.

comment:5 retlehs10 months ago

  • Cc retlehs added
  • Keywords has-patch removed
  • Resolution invalid deleted
  • Status changed from closed to reopened
  • Version 2.7.1 deleted

I'd like to have this setting. Not because of the original ticket description, "...to make WordPress shared hosting friendly...", but because of having the ability to set both media settings for uploads via wp-config.php.

Right now we can define the uploads directory but can't define the organize uploads into folders setting.

comment:6 nacin10 months ago

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

You could always use a filter via get_option() to actually enforce a particular choice. It's not perfect, but it works just fine.

I don't think this should be a constant — we ideally want to avoid constants for non-essential stuff, and this doesn't require a constant or filesystem-level enforcement.

Note: See TracTickets for help on using tickets.