Created
July 19, 2012 20:59
-
-
Save kurtpayne/3146775 to your computer and use it in GitHub Desktop.
Don't create a new NOOP_Translations object for every domain
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Index: wp-includes/l10n.php | |
IDEA additional info: | |
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP | |
<+>UTF-8 | |
=================================================================== | |
--- wp-includes/l10n.php (revision 21279) | |
+++ wp-includes/l10n.php (revision ) | |
@@ -493,10 +493,11 @@ | |
* @param string $domain | |
* @return object A Translation instance | |
*/ | |
+$noop_translation = new NOOP_Translations(); | |
function &get_translations_for_domain( $domain ) { | |
- global $l10n; | |
+ global $l10n, $noop_translation; | |
if ( !isset( $l10n[$domain] ) ) { | |
- $l10n[$domain] = new NOOP_Translations; | |
+ $l10n[$domain] = $noop_translation; | |
} | |
return $l10n[$domain]; | |
} | |
\ No newline at end of file |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment