[wp-trac] [WordPress Trac] #39210: switch_to_locale() unloads all plugin and theme translations

WordPress Trac noreply at wordpress.org
Mon Oct 19 23:43:19 UTC 2020


#39210: switch_to_locale() unloads all plugin and theme translations
----------------------------------------------------+---------------------
 Reporter:  gchtr                                   |       Owner:  (none)
     Type:  defect (bug)                            |      Status:  new
 Priority:  normal                                  |   Milestone:  5.6
Component:  I18N                                    |     Version:  4.7
 Severity:  normal                                  |  Resolution:
 Keywords:  has-patch has-unit-tests needs-testing  |     Focuses:
----------------------------------------------------+---------------------

Comment (by dd32):

 Replying to [comment:28 ocean90]:
 > dd32 Instead of adding the new flag to `unload_textdomain()` the latest
 patch doesn't call `unload_textdomain()` anymore, instead it
 [https://github.com/WordPress/wordpress-
 develop/pull/613#discussion_r507067828 "uses unset( $l10n[ $domain ] );"].
 Curious what you think about this.

 It seems fine to me, it's cleaner than the extra parameter IMHO, although
 it should probably be documented in the code as to why it unsets the
 global rather than calling the API (unload_textdomain) as it may not seem
 obvious at first to a casual reader.

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/39210#comment:29>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list