From c86ffe454aba49e37f8c61f2167d85eb4b261bbc Mon Sep 17 00:00:00 2001 From: "Dominik Schilling (ocean90)" Date: Wed, 13 Jan 2016 13:03:21 +0000 Subject: [PATCH] Plugins: In `_get_plugin_data_markup_translate()` don't reload translations if they're already loaded. Props jrf. Fixes #35439. git-svn-id: https://develop.svn.wordpress.org/trunk@36282 602fd350-edb4-49c9-b593-d223f7449a82 --- src/wp-admin/includes/plugin.php | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/wp-admin/includes/plugin.php b/src/wp-admin/includes/plugin.php index 415ef5b5ea..bd840539e3 100644 --- a/src/wp-admin/includes/plugin.php +++ b/src/wp-admin/includes/plugin.php @@ -117,10 +117,13 @@ function _get_plugin_data_markup_translate( $plugin_file, $plugin_data, $markup // Translate fields if ( $translate ) { if ( $textdomain = $plugin_data['TextDomain'] ) { - if ( $plugin_data['DomainPath'] ) - load_plugin_textdomain( $textdomain, false, dirname( $plugin_file ) . $plugin_data['DomainPath'] ); - else - load_plugin_textdomain( $textdomain, false, dirname( $plugin_file ) ); + if ( ! is_textdomain_loaded( $textdomain ) ) { + if ( $plugin_data['DomainPath'] ) { + load_plugin_textdomain( $textdomain, false, dirname( $plugin_file ) . $plugin_data['DomainPath'] ); + } else { + load_plugin_textdomain( $textdomain, false, dirname( $plugin_file ) ); + } + } } elseif ( in_array( basename( $plugin_file ), array( 'hello.php', 'akismet.php' ) ) ) { $textdomain = 'default'; }