bedrock icon indicating copy to clipboard operation
bedrock copied to clipboard

Custom plugins, uploads & themes directories

Open ahmu83 opened this issue 1 year ago • 2 comments

Summary

I tried setting up custom plugins, uploads & themes directory but I am not getting the expected output. In my ./config/application.php I added this:

// Define theme directory and URL if THEMES_DIR is set in .env
if (env('THEMES_DIR')) {
    Config::define('WP_THEME_DIR', $webroot_dir . '/app/' . env('THEMES_DIR'));
    Config::define('WP_THEME_URL', Config::get('WP_HOME') . '/app/' . env('THEMES_DIR'));
}

// Define plugin directory and URL if PLUGINS_DIR is set in .env
if (env('PLUGINS_DIR')) {
    Config::define('WP_PLUGIN_DIR', $webroot_dir . '/app/' . env('PLUGINS_DIR'));
    Config::define('WP_PLUGIN_URL', Config::get('WP_HOME') . '/app/' . env('PLUGINS_DIR'));
}

// Define uploads directory if UPLOADS_DIR is set in .env
if (env('UPLOADS_DIR')) {
    Config::define('UPLOADS', 'app/' . env('UPLOADS_DIR'));
}

And in my ./.env I added these values:

# custom directories for plugins, themes & uploads
THEMES_DIR='static/theme'
PLUGINS_DIR='static/addon'
UPLOADS_DIR='static/media'

When I upload a file in wp-admin it adds wp to the url http://site.test/wp/app/static/media/2025/02/img.png instead http://site.test/app/static/media/2025/02/img.png

Additional context

No response

ahmu83 avatar Feb 03 '25 19:02 ahmu83

Are you missing a '/' in app/?

Config::define('UPLOADS', 'app/' . env('UPLOADS_DIR'));

MeonValleyWeb avatar Feb 12 '25 12:02 MeonValleyWeb

Head over to https://discourse.roots.io/ for support requests

retlehs avatar Feb 14 '25 17:02 retlehs