Theme Installer/Updater: Handle custom Theme directories when updating themes, and installing new themes. Fixes #22501

git-svn-id: https://develop.svn.wordpress.org/trunk@25082 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Dion Hulse
2013-08-22 04:49:06 +00:00
parent ddad24c82c
commit 2ceaba8b30
2 changed files with 51 additions and 37 deletions
@@ -79,10 +79,17 @@ class WP_Filesystem_Base {
* @since 2.7
* @access public
*
* @param string $theme The Theme stylesheet or template for the directory
* @return string The location of the remote path.
*/
function wp_themes_dir() {
return $this->wp_content_dir() . 'themes/';
function wp_themes_dir( $theme = false ) {
$theme_root = get_theme_root( $theme );
// Account for relative theme roots
if ( '/themes' == $theme_root || ! is_dir( $theme_root ) )
$theme_root = WP_CONTENT_DIR . $theme_root;
return $this->find_folder( $theme_root );
}
/**
* Returns the path on the remote filesystem of WP_LANG_DIR