IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
|
|
|
370 | 370 | function get_theme_roots() { |
371 | 371 | global $wp_theme_directories; |
372 | 372 | |
373 | | if ( ! is_array( $wp_theme_directories ) || count( $wp_theme_directories ) <= 1 ) { |
| 373 | if ( ( ! is_array( $wp_theme_directories ) || count( $wp_theme_directories ) <= 1 ) and ! has_filter( 'theme_root' ) ) { |
374 | 374 | return '/themes'; |
375 | 375 | } |
376 | 376 | |
… |
… |
|
658 | 658 | function get_raw_theme_root( $stylesheet_or_template, $skip_cache = false ) { |
659 | 659 | global $wp_theme_directories; |
660 | 660 | |
661 | | if ( ! is_array( $wp_theme_directories ) || count( $wp_theme_directories ) <= 1 ) { |
| 661 | if ( ( ! is_array( $wp_theme_directories ) || count( $wp_theme_directories ) <= 1 ) and ! has_filter( 'theme_root' ) ) { |
662 | 662 | return '/themes'; |
663 | 663 | } |
664 | 664 | |
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
|
|
|
2931 | 2931 | */ |
2932 | 2932 | function make_site_theme_from_oldschool( $theme_name, $template ) { |
2933 | 2933 | $home_path = get_home_path(); |
2934 | | $site_dir = WP_CONTENT_DIR . "/themes/$template"; |
| 2934 | $site_dir = path_join( get_theme_root(), $template ); |
2935 | 2935 | |
2936 | 2936 | if ( ! file_exists( "$home_path/index.php" ) ) { |
2937 | 2937 | return false; |
… |
… |
|
2959 | 2959 | if ( $oldfile == 'index.php' ) { |
2960 | 2960 | $index = implode( '', file( "$oldpath/$oldfile" ) ); |
2961 | 2961 | if ( strpos( $index, 'WP_USE_THEMES' ) !== false ) { |
2962 | | if ( ! @copy( WP_CONTENT_DIR . '/themes/' . WP_DEFAULT_THEME . '/index.php', "$site_dir/$newfile" ) ) { |
| 2962 | if ( ! @copy( path_join( get_theme_root(), WP_DEFAULT_THEME . '/index.php' ), "$site_dir/$newfile" ) ) { |
2963 | 2963 | return false; |
2964 | 2964 | } |
2965 | 2965 | |
… |
… |
|
3023 | 3023 | * @return false|void |
3024 | 3024 | */ |
3025 | 3025 | function make_site_theme_from_default( $theme_name, $template ) { |
3026 | | $site_dir = WP_CONTENT_DIR . "/themes/$template"; |
3027 | | $default_dir = WP_CONTENT_DIR . '/themes/' . WP_DEFAULT_THEME; |
| 3026 | $site_dir = path_join( get_theme_root(), $template ); |
| 3027 | $default_dir = path_join( get_theme_root(), WP_DEFAULT_THEME ); |
3028 | 3028 | |
3029 | 3029 | // Copy files from the default theme to the site theme. |
3030 | 3030 | //$files = array('index.php', 'comments.php', 'comments-popup.php', 'footer.php', 'header.php', 'sidebar.php', 'style.css'); |
… |
… |
|
3099 | 3099 | // Name the theme after the blog. |
3100 | 3100 | $theme_name = __get_option( 'blogname' ); |
3101 | 3101 | $template = sanitize_title( $theme_name ); |
3102 | | $site_dir = WP_CONTENT_DIR . "/themes/$template"; |
| 3102 | $site_dir = path_join( get_theme_root(), $template ); |
3103 | 3103 | |
3104 | 3104 | // If the theme already exists, nothing to do. |
3105 | 3105 | if ( is_dir( $site_dir ) ) { |
… |
… |
|
3107 | 3107 | } |
3108 | 3108 | |
3109 | 3109 | // We must be able to write to the themes dir. |
3110 | | if ( ! is_writable( WP_CONTENT_DIR . '/themes' ) ) { |
| 3110 | if ( ! is_writable( get_theme_root() ) ) { |
3111 | 3111 | return false; |
3112 | 3112 | } |
3113 | 3113 | |
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
|
|
|
533 | 533 | * to copy the directory into the directory, whilst they pass the source |
534 | 534 | * as the actual files to copy. |
535 | 535 | */ |
536 | | $protected_directories = array( ABSPATH, WP_CONTENT_DIR, WP_PLUGIN_DIR, WP_CONTENT_DIR . '/themes' ); |
| 536 | $protected_directories = array( ABSPATH, WP_CONTENT_DIR, WP_PLUGIN_DIR, get_theme_root() ); |
537 | 537 | |
538 | 538 | if ( is_array( $wp_theme_directories ) ) { |
539 | 539 | $protected_directories = array_merge( $protected_directories, $wp_theme_directories ); |