This page redirects to an external site: https://developer.wordpress.org/reference/functions/unload_textdomain/
Unloads translations for a domain
<code style="color: #000000"><span style="color: #0000BB"><?php unload_textdomain</span><span style="color: #007700">( </span><span style="color: #0000BB">$domain </span><span style="color: #007700">); </span><span style="color: #0000BB">?></span></code>
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