register theme directory() not working for themes outside WP_CONTENT_DIR
|Reported by:||tliebig||Owned by:||nacin|
I'm trying to add an additional theme directory that lives outside WP_CONTENT_DIR.
To do so, I've added
global $wp_theme_directories; $wp_theme_directories = $_SERVER['DOCUMENT_ROOT'].'/wp-content/themes';
to my wp-config.php.
The problem: Although WordPress correctly finds the themes within my custom theme folder, it reports them to be broken as soon as I activate them. From my investigations, this seems to be an issue with get_theme_root() putting the WP_CONTENT_DIR before the path although it should not do so when I give it the full file system path for my own theme directory (http://codex.wordpress.org/Function_Reference/register_theme_directory).
Completely moving /wp-content/ via WP_CONTENT_DIR constant is not an option since that would require me to store the default theme and the language files outside the /wordpress structure, which I'm trying to avoid. My goal ist to basically trying to remodel the strict separation between application/user data that the mac file system does: store application under /apps, and user data (including custom settings) under /home. This approach would allow to update WordPress as easily as just replacing the /wordpress-folder completely with the unzipped files from a freshly downloaded wordpress package without having to worry about /wp-content.
My final desired structure would be as such:
/ /wordpress (the virgin WordPress system directory as downloaded) /wp-config.php (my custom wp-config.php holding my settings) /wp-content/plugins (folder holding the plugins that I've installed) /wp-content/themes (folder holding the themes that I've installed) /uploads (folder holding the user's uploads)
 would be great if it could be merged with the system plugins from /wordpress/wp-content/plugins, but for now it's okay if I just define the WP_PLUGIN_URL constant
 Expected to merge with /wordpress/wp-content/themes, but not working: themes within this folder are shown in the backend, but reported to be broken when I try to activate them. This is where register_theme_directory() does not work as advertised.
Change History (15)
- Owner set to nacin
- Resolution set to fixed
- Status changed from new to closed