Make WordPress Core


Ignore:
Timestamp:
08/22/2013 04:49:06 AM (12 years ago)
Author:
dd32
Message:

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

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/includes/class-wp-filesystem-base.php

    r25057 r25082  
    8080     * @access public
    8181     *
    82      * @return string The location of the remote path.
    83      */
    84     function wp_themes_dir() {
    85         return $this->wp_content_dir() . 'themes/';
     82     * @param string $theme The Theme stylesheet or template for the directory
     83     * @return string The location of the remote path.
     84     */
     85    function wp_themes_dir( $theme = false ) {
     86        $theme_root = get_theme_root( $theme );
     87
     88        // Account for relative theme roots
     89        if ( '/themes' == $theme_root || ! is_dir( $theme_root ) )
     90            $theme_root = WP_CONTENT_DIR . $theme_root;
     91
     92        return $this->find_folder( $theme_root );
    8693    }
    8794    /**
Note: See TracChangeset for help on using the changeset viewer.