IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
|
|
|
|
| 204 | 204 | } |
| 205 | 205 | } |
| 206 | 206 | |
| | 207 | /** |
| | 208 | * Defines theme directory WordPress constants |
| | 209 | * |
| | 210 | * @since 5.3.0 |
| | 211 | */ |
| | 212 | function wp_theme_directory_constants() { |
| | 213 | /** |
| | 214 | * Allows for the define custom themes directory name. |
| | 215 | * |
| | 216 | * @since 5.3.0 |
| | 217 | */ |
| | 218 | if ( ! defined( 'WP_THEMES_DIR' ) ) { |
| | 219 | define( 'WP_THEMES_DIR', 'themes' ); |
| | 220 | } |
| | 221 | |
| | 222 | /** |
| | 223 | * Allows for the define custom themes directory location. |
| | 224 | * |
| | 225 | * @since 5.3.0 |
| | 226 | */ |
| | 227 | if ( ! defined( 'WP_THEMES_PATH' ) ) { |
| | 228 | define( 'WP_THEMES_PATH', WP_CONTENT_DIR . '/' . WP_THEMES_DIR ); // full path of WordPress themes directory |
| | 229 | } |
| | 230 | |
| | 231 | /** |
| | 232 | * Allows for the themes directory to be change default url. |
| | 233 | * |
| | 234 | * @since 5.3.0 |
| | 235 | */ |
| | 236 | if ( ! defined( 'WP_THEMES_URL' ) ) { |
| | 237 | define( 'WP_THEMES_URL', content_url( WP_THEMES_DIR ) ); // full url, no trailing slash |
| | 238 | } |
| | 239 | } |
| | 240 | |
| 207 | 241 | /** |
| 208 | 242 | * Defines cookie related WordPress constants |
| 209 | 243 | * |
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
|
|
|
|
| 95 | 95 | $theme_root = get_theme_root( $theme ); |
| 96 | 96 | |
| 97 | 97 | // Account for relative theme roots |
| 98 | | if ( '/themes' == $theme_root || ! is_dir( $theme_root ) ) { |
| | 98 | if ( '/' . WP_THEMES_DIR == $theme_root || ! is_dir( $theme_root ) ) { |
| 99 | 99 | $theme_root = WP_CONTENT_DIR . $theme_root; |
| 100 | 100 | } |
| 101 | 101 | |
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
|
|
|
|
| 333 | 333 | |
| 334 | 334 | wp_start_scraping_edited_file_errors(); |
| 335 | 335 | |
| | 336 | // Define WordPress themes constants. |
| | 337 | wp_theme_directory_constants(); |
| | 338 | |
| 336 | 339 | // Register the default theme directory root |
| 337 | 340 | register_theme_directory( get_theme_root() ); |
| 338 | 341 | |
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, WP_THEMES_PATH ); |
| 537 | 537 | |
| 538 | 538 | if ( is_array( $wp_theme_directories ) ) { |
| 539 | 539 | $protected_directories = array_merge( $protected_directories, $wp_theme_directories ); |
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 ) { |
| 374 | | return '/themes'; |
| | 373 | if ( ! is_array( $wp_theme_directories ) || ( count( $wp_theme_directories ) == 1 and $wp_theme_directories[0] == WP_THEMES_PATH and WP_THEMES_DIR == 'themes' ) ) { |
| | 374 | return '/'. WP_THEMES_DIR; |
| 375 | 375 | } |
| 376 | 376 | |
| 377 | 377 | $theme_roots = get_site_transient( 'theme_roots' ); |
| … |
… |
|
| 577 | 577 | $theme_root = WP_CONTENT_DIR . $theme_root; |
| 578 | 578 | } |
| 579 | 579 | } else { |
| 580 | | $theme_root = WP_CONTENT_DIR . '/themes'; |
| | 580 | $theme_root = WP_CONTENT_DIR . '/' . WP_THEMES_DIR; |
| | 581 | if ( $theme_root != WP_THEMES_PATH ) { |
| | 582 | $theme_root = WP_THEMES_PATH; |
| | 583 | } |
| 581 | 584 | } |
| 582 | 585 | |
| 583 | 586 | /** |
| … |
… |
|
| 628 | 631 | $theme_root_uri = content_url( $theme_root ); |
| 629 | 632 | } |
| 630 | 633 | } else { |
| 631 | | $theme_root_uri = content_url( 'themes' ); |
| | 634 | $theme_root_uri = content_url( WP_THEMES_DIR ); |
| | 635 | } |
| | 636 | |
| | 637 | /** |
| | 638 | * Check if defined new WordPress themes directory constant. |
| | 639 | * |
| | 640 | * @since 5.3.0 |
| | 641 | */ |
| | 642 | if ( content_url( 'themes' ) != WP_THEMES_URL ) { |
| | 643 | $theme_root_uri = WP_THEMES_URL; |
| 632 | 644 | } |
| 633 | 645 | |
| 634 | 646 | /** |
| … |
… |
|
| 658 | 670 | function get_raw_theme_root( $stylesheet_or_template, $skip_cache = false ) { |
| 659 | 671 | global $wp_theme_directories; |
| 660 | 672 | |
| 661 | | if ( ! is_array( $wp_theme_directories ) || count( $wp_theme_directories ) <= 1 ) { |
| 662 | | return '/themes'; |
| | 673 | if ( ! is_array( $wp_theme_directories ) || ( count( $wp_theme_directories ) == 1 and $wp_theme_directories[0] == WP_THEMES_PATH and WP_THEMES_DIR == 'themes' ) ) { |
| | 674 | return '/'. WP_THEMES_DIR; |
| 663 | 675 | } |
| 664 | 676 | |
| 665 | 677 | $theme_root = false; |