diff --git a/wp-includes/l10n.php b/wp-includes/l10n.php index 1f3532a40d..13d307fca9 100644 --- a/wp-includes/l10n.php +++ b/wp-includes/l10n.php @@ -1207,7 +1207,15 @@ function load_script_textdomain( $handle, $domain = 'default', $path = '' ) { $relative = trim( $relative, '/' ); $relative = explode( '/', $relative ); - $languages_path = WP_LANG_DIR . '/plugins'; + /* + * Ensure correct languages path when using a custom `WP_PLUGIN_DIR` / `WP_PLUGIN_URL` configuration. + * See https://core.trac.wordpress.org/ticket/60891 and https://core.trac.wordpress.org/ticket/62016. + */ + $plugins_dir = array_slice( explode( '/', $plugins_url['path'] ), 2 ); + $plugins_dir = trim( $plugins_dir[0], '/' ); + $dirname = $plugins_dir === $relative[0] ? 'plugins' : 'themes'; + + $languages_path = WP_LANG_DIR . '/' . $dirname; $relative = array_slice( $relative, 2 ); // Remove plugins/ or themes/. $relative = implode( '/', $relative ); diff --git a/wp-includes/version.php b/wp-includes/version.php index 2b0f2a659c..05b1796e8e 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -16,7 +16,7 @@ * * @global string $wp_version */ -$wp_version = '6.7-alpha-59125'; +$wp_version = '6.7-alpha-59126'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.