devgeniem/wp-define-more

Adds useful definable constants which are missing from the WP Core.


Keywords
wordpress, options, uploads, wp, filesize, define, max
License
GPL-2.0

Documentation

geniem-github-banner

WP Plugin: Define More

Build Status Latest Stable Version Total Downloads Latest Unstable Version License

WordPress contains multiple nice options which you can set with define().

You can see good list of all them here: http://wpengineer.com/2382/wordpress-constants-overview/

This plugin adds even more stuff you can define().

Current custom definable variables

WP_UPLOADS_MAX_SIZE

WP_UPLOADS_MAX_SIZE - Set this to tell WordPress maximum uploads size. This is useful to tell /wp-admin/media.php javascript the maximum filesize in case your WordPress is running behind reverse proxy.

Example:

define('WP_UPLOADS_MAX_SIZE','10M');

WP_UPLOADS_DIR

WP_UPLOADS_DIR - Set custom directory for your uploads. This helped us to use glusterfs to synchronize only uploads folder between multiple nodes. It was too heavy process and much too unreliable to sync everything.

Example:

define('WP_UPLOADS_DIR','/var/www/uploads');

WP_UPLOADS_URL

WP_UPLOADS_URL - Set custom url for your uploads. We used this for mapping custom http://wordpress.test/uploads/ url with custom nginx root to WP_UPLOADS_DIR.

Example:

define('WP_UPLOADS_URL', WP_SITEURL . '/uploads/');