WordPress.org

Make WordPress Core

Ticket #10971: use-noop-translations.php

File use-noop-translations.php, 502 bytes (added by nbachiyski, 4 years ago)
Line 
1Index: wp-includes/l10n.php
2===================================================================
3--- wp-includes/l10n.php        (revision 12078)
4+++ wp-includes/l10n.php        (working copy)
5@@ -404,11 +404,10 @@
6  */
7 function &get_translations_for_domain( $domain ) {
8        global $l10n;
9-       $empty = &new Translations;
10-       if ( isset($l10n[$domain]) )
11-               return $l10n[$domain];
12-       else
13-               return $empty;
14+       if ( !isset($l10n[$domain]) ) {
15+               $l10n[$domain] = &new NOOP_Translations;
16+       }
17+       return $l10n[$domain];
18 }
19 
20 /**