Notice: Function _load_textdomain_just_in_time was called incorrectly. Translation loading for the hcaptcha-for-forms-and-more domain was triggered too early. This is usually an indicator for some code in the plugin or theme running too early. Translations should be loaded at the init action or later. Please see Debugging in WordPress for more information. (This message was added in version 6.7.0.) in /home/cassenet/domains/cass-e.net/public_html/wp-includes/functions.php on line 6114

Notice: Function _load_textdomain_just_in_time was called incorrectly. Translation loading for the hcaptcha-for-forms-and-more domain was triggered too early. This is usually an indicator for some code in the plugin or theme running too early. Translations should be loaded at the init action or later. Please see Debugging in WordPress for more information. (This message was added in version 6.7.0.) in /home/cassenet/domains/cass-e.net/public_html/wp-includes/functions.php on line 6114

Notice: Function _load_textdomain_just_in_time was called incorrectly. Translation loading for the wordpress-seo domain was triggered too early. This is usually an indicator for some code in the plugin or theme running too early. Translations should be loaded at the init action or later. Please see Debugging in WordPress for more information. (This message was added in version 6.7.0.) in /home/cassenet/domains/cass-e.net/public_html/wp-includes/functions.php on line 6114
Upload Directory Fix Wordpress Plugin - Cass-E Design

Cass-E Design

Design, Experiments, Games, Resources

Upload Directory Fix WordPress Plugin

So around a week ago, every image on my site broke.

TL;DR

This plugin should allow you to hardcode your upload directory in the event that the UPLOADS constant doesn't work. This is a quick, and incredibly dirty fix. You can find it on github:

https://github.com/cass-e-design/fix-uploads-dir
Fix-uploads-dir on github
(Sidenote: this is the Github Embed plugin by Lee Willis in action!)

Backstory

WordPress, by default, uses /wp-content/uploads for uploads, usually images. You can customize this and other directories using PHP constants, usually set in wp-config.php. WordPress briefly documents these constants here.

I use the UPLOADS constant to put my uploads in /media instead because I like it more. Until about a week ago.

I'm not sure if it was a wordpress update, a plugin, or a change with my hosting behind the scenes. I was working on developing a plugin at the time, I suspected that I'd just broken something. I tried disabling 99% of my plugins, with no dice. I triple checked the database. Etcetera. For one reason or another, wordpress started ignoring the UPLOADS constant.

Fix Uploads Dir uses the WordPress filter upload_dir to manually ater the url WordPress fetches for attachments. It's messy and far from perfect, but functional for me. I've also created a basic settings page (an act that took twice the code of the original plugin) to allow you to configure it without just hardcoding.

I guiltily hope that this has ever been an issue for someone else, so that this proves useful. I know there were approximately 0 helpful results when I started looking into this. And it'd be neat to be that helpful person once.

Previous Post

Next Post