Index: wp-includes/default-constants.php
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- wp-includes/default-constants.php	(date 1555691334000)
+++ wp-includes/default-constants.php	(date 1555768063510)
@@ -204,6 +204,40 @@
 	}
 }
 
+/**
+ * Defines theme directory WordPress constants
+ *
+ * @since 5.3.0
+ */
+function wp_theme_directory_constants() {
+	/**
+	 * Allows for the define custom themes directory name.
+	 *
+	 * @since 5.3.0
+	 */
+	if ( ! defined( 'WP_THEMES_DIR' ) ) {
+		define( 'WP_THEMES_DIR', 'themes' );
+	}
+
+	/**
+	 * Allows for the define custom themes directory location.
+	 *
+	 * @since 5.3.0
+	 */
+	if ( ! defined( 'WP_THEMES_PATH' ) ) {
+		define( 'WP_THEMES_PATH', WP_CONTENT_DIR . '/' . WP_THEMES_DIR ); // full path of WordPress themes directory
+	}
+
+	/**
+	 * Allows for the themes directory to be change default url.
+	 *
+	 * @since 5.3.0
+	 */
+	if ( ! defined( 'WP_THEMES_URL' ) ) {
+		define( 'WP_THEMES_URL', content_url( WP_THEMES_DIR ) ); // full url, no trailing slash
+	}
+}
+
 /**
  * Defines cookie related WordPress constants
  *
Index: wp-admin/includes/class-wp-filesystem-base.php
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- wp-admin/includes/class-wp-filesystem-base.php	(date 1555691334000)
+++ wp-admin/includes/class-wp-filesystem-base.php	(date 1555698442135)
@@ -95,7 +95,7 @@
 		$theme_root = get_theme_root( $theme );
 
 		// Account for relative theme roots
-		if ( '/themes' == $theme_root || ! is_dir( $theme_root ) ) {
+		if ( '/' . WP_THEMES_DIR == $theme_root || ! is_dir( $theme_root ) ) {
 			$theme_root = WP_CONTENT_DIR . $theme_root;
 		}
 
Index: wp-settings.php
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- wp-settings.php	(date 1555691334000)
+++ wp-settings.php	(date 1555698254341)
@@ -333,6 +333,9 @@
 
 wp_start_scraping_edited_file_errors();
 
+// Define WordPress themes constants.
+wp_theme_directory_constants();
+
 // Register the default theme directory root
 register_theme_directory( get_theme_root() );
 
Index: wp-admin/includes/class-wp-upgrader.php
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- wp-admin/includes/class-wp-upgrader.php	(date 1555691334000)
+++ wp-admin/includes/class-wp-upgrader.php	(date 1555698442304)
@@ -533,7 +533,7 @@
 		 * to copy the directory into the directory, whilst they pass the source
 		 * as the actual files to copy.
 		 */
-		$protected_directories = array( ABSPATH, WP_CONTENT_DIR, WP_PLUGIN_DIR, WP_CONTENT_DIR . '/themes' );
+		$protected_directories = array( ABSPATH, WP_CONTENT_DIR, WP_PLUGIN_DIR, WP_THEMES_PATH );
 
 		if ( is_array( $wp_theme_directories ) ) {
 			$protected_directories = array_merge( $protected_directories, $wp_theme_directories );
Index: wp-includes/theme.php
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- wp-includes/theme.php	(date 1555691334000)
+++ wp-includes/theme.php	(date 1555768063245)
@@ -370,8 +370,8 @@
 function get_theme_roots() {
 	global $wp_theme_directories;
 
-	if ( ! is_array( $wp_theme_directories ) || count( $wp_theme_directories ) <= 1 ) {
-		return '/themes';
+	if ( ! is_array( $wp_theme_directories ) || ( count( $wp_theme_directories ) == 1 and $wp_theme_directories[0] == WP_THEMES_PATH and WP_THEMES_DIR == 'themes' ) ) {
+		return '/'. WP_THEMES_DIR;
 	}
 
 	$theme_roots = get_site_transient( 'theme_roots' );
@@ -577,7 +577,10 @@
 			$theme_root = WP_CONTENT_DIR . $theme_root;
 		}
 	} else {
-		$theme_root = WP_CONTENT_DIR . '/themes';
+		$theme_root = WP_CONTENT_DIR . '/' . WP_THEMES_DIR;
+		if ( $theme_root != WP_THEMES_PATH ) {
+			$theme_root = WP_THEMES_PATH;
+		}
 	}
 
 	/**
@@ -628,7 +631,16 @@
 			$theme_root_uri = content_url( $theme_root );
 		}
 	} else {
-		$theme_root_uri = content_url( 'themes' );
+		$theme_root_uri = content_url( WP_THEMES_DIR );
+	}
+
+	/**
+	 * Check if defined new WordPress themes directory constant.
+	 *
+	 * @since 5.3.0
+	 */
+	if ( content_url( 'themes' ) != WP_THEMES_URL ) {
+		$theme_root_uri = WP_THEMES_URL;
 	}
 
 	/**
@@ -658,8 +670,8 @@
 function get_raw_theme_root( $stylesheet_or_template, $skip_cache = false ) {
 	global $wp_theme_directories;
 
-	if ( ! is_array( $wp_theme_directories ) || count( $wp_theme_directories ) <= 1 ) {
-		return '/themes';
+	if ( ! is_array( $wp_theme_directories ) || ( count( $wp_theme_directories ) == 1 and $wp_theme_directories[0] == WP_THEMES_PATH and WP_THEMES_DIR == 'themes' ) ) {
+	    return '/'. WP_THEMES_DIR;
 	}
 
 	$theme_root = false;
