Unloads translations for a domain
<?php unload_textdomain( $domain ); ?>
In case you need to prevent a text domain from unloading, the override_unload_textdomain filter is called before attempting to unload the text domain.
add_filter( 'override_unload_textdomain', 'myplugin_override_unload_textdomain' ); function myplugin_override_unload_textdomain( $override, $domain ) { if ( $domain === 'my-domain' ) { // Prevents WordPress from unloading this text domain $override = true; } return $override; }
Immediately before unloading a text domain, the unload_textdomain action is called to notify WordPress that the text domain is being unloaded.
add_action( 'unload_textdomain', 'myplugin_unload_textdomain' ); function myplugin_unload_textdomain( $domain ) { // add code here to handle the unloading the text domain }
Since: 3.0
unload_textdomain() is located in wp-includes/l10n.php