[wp-trac] [WordPress Trac] #37113: unload_textdomain() not working for text domains that are loaded just in time

WordPress Trac noreply at wordpress.org
Thu Jun 16 11:30:07 UTC 2016


#37113: unload_textdomain() not working for text domains that are loaded just in
time
------------------------------------------+-------------------------
 Reporter:  swissspidy                    |       Owner:  swissspidy
     Type:  defect (bug)                  |      Status:  assigned
 Priority:  normal                        |   Milestone:  4.6
Component:  General                       |     Version:  trunk
 Severity:  normal                        |  Resolution:
 Keywords:  needs-patch needs-unit-tests  |     Focuses:
------------------------------------------+-------------------------
Description changed by swissspidy:

Old description:

> #34114 removed the requirement to call `load_plugin_textdomain()` or
> `load_theme_textdomain()` by checking the languages directory for
> available translation files.
>
> However, as pointed out by @opajaap in the
> [https://wordpress.org/support/topic/duplicateunwanted-loading-of-plugin-
> textdomain support forums], `unload_textdomain()` does not work anymore
> because that. `_load_textdomain_just_in_time()` would simply load the
> text domain again and again.
>
> We need some sorts of global array to keep track of unloaded text
> domains, which `_load_textdomain_just_in_time()` would ignore. Unloaded
> text domains would need to be loaded explicitly if one wants to use it
> again — like before.
>
> Will whip up a patch shortly.

New description:

 #34114 removed the requirement to call `load_plugin_textdomain()` or
 `load_theme_textdomain()` by checking the languages directory for
 available translation files.

 However, as pointed out by @opajaap in the
 [https://wordpress.org/support/topic/duplicateunwanted-loading-of-plugin-
 textdomain support forums], `unload_textdomain()` does not work anymore
 because of that. `_load_textdomain_just_in_time()` would simply load the
 text domain again and again.

 We need some sorts of global array to keep track of unloaded text domains,
 which `_load_textdomain_just_in_time()` would ignore. Unloaded text
 domains would need to be loaded explicitly if one wants to use it again —
 like before.

 Will whip up a patch shortly.

--

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


More information about the wp-trac mailing list