[wp-trac] [WordPress Trac] #17597: register theme directory() not working for themes outside WP_CONTENT_DIR

WordPress Trac wp-trac at lists.automattic.com
Sat May 28 11:53:48 UTC 2011


#17597: register theme directory() not working for themes outside WP_CONTENT_DIR
--------------------------+-----------------------------
 Reporter:  tliebig       |      Owner:
     Type:  defect (bug)  |     Status:  new
 Priority:  normal        |  Milestone:  Awaiting Review
Component:  Themes        |    Version:  3.1.3
 Severity:  normal        |   Keywords:
--------------------------+-----------------------------
 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)[1]
 /wp-content/themes      (folder holding the themes that I've installed)[2]
 /uploads                (folder holding the user's uploads)
 }}}


 [1] 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

 [2] 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.__

-- 
Ticket URL: <http://core.trac.wordpress.org/ticket/17597>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list