From 7a2e6d943e97817da06f89154ef22a6cd6c0a0c9 Mon Sep 17 00:00:00 2001
From: jrfnl <github_nospam@adviesenzo.nl>
Date: Wed, 13 Jan 2016 05:33:06 +0100
Subject: [PATCH] Prevent loading text domain twice if the domain is already
loaded on the plugins.php admin page.
---
src/wp-admin/includes/plugin.php | 12 ++++++++----
1 file changed, 8 insertions(+), 4 deletions(-)
diff --git a/src/wp-admin/includes/plugin.php b/src/wp-admin/includes/plugin.php
index 415ef5b..c26acde 100644
a
|
b
|
function _get_plugin_data_markup_translate( $plugin_file, $plugin_data, $markup |
117 | 117 | // Translate fields |
118 | 118 | if ( $translate ) { |
119 | 119 | if ( $textdomain = $plugin_data['TextDomain'] ) { |
120 | | if ( $plugin_data['DomainPath'] ) |
121 | | load_plugin_textdomain( $textdomain, false, dirname( $plugin_file ) . $plugin_data['DomainPath'] ); |
122 | | else |
123 | | load_plugin_textdomain( $textdomain, false, dirname( $plugin_file ) ); |
| 120 | if ( ! is_textdomain_loaded( $textdomain ) ) { |
| 121 | if ( $plugin_data['DomainPath'] ) { |
| 122 | load_plugin_textdomain( $textdomain, false, dirname( $plugin_file ) . $plugin_data['DomainPath'] ); |
| 123 | } |
| 124 | else { |
| 125 | load_plugin_textdomain( $textdomain, false, dirname( $plugin_file ) ); |
| 126 | } |
| 127 | } |
124 | 128 | } elseif ( in_array( basename( $plugin_file ), array( 'hello.php', 'akismet.php' ) ) ) { |
125 | 129 | $textdomain = 'default'; |
126 | 130 | } |