Filter hook 'override_load_textdomain'

in WP Core File wp-includes/l10n.php at line 769

View Source

override_load_textdomain

Filter Hook
Description
Filters whether to override the .mo file loading.

Hook Information

File Location wp-includes/l10n.php View on GitHub
Hook Type Filter
Line Number 769

Hook Parameters

Type Name Description
bool $override Whether to override the .mo file loading. Default false.
string $domain Text domain. Unique identifier for retrieving translated strings.
string $mofile Path to the MO file.
string|null $locale Locale.

Usage Examples

Basic Usage
<?php
// Hook into override_load_textdomain
add_filter('override_load_textdomain', 'my_custom_filter', 10, 4);

function my_custom_filter($override, $domain, $mofile, $locale) {
    // Your custom filtering logic here
    return $override;
}

Source Code Context

wp-includes/l10n.php:769 - How this hook is used in WordPress core
<?php
 764  	 * @param bool        $override Whether to override the .mo file loading. Default false.
 765  	 * @param string      $domain   Text domain. Unique identifier for retrieving translated strings.
 766  	 * @param string      $mofile   Path to the MO file.
 767  	 * @param string|null $locale   Locale.
 768  	 */
 769  	$plugin_override = apply_filters( 'override_load_textdomain', false, $domain, $mofile, $locale );
 770  
 771  	if ( true === (bool) $plugin_override ) {
 772  		unset( $l10n_unloaded[ $domain ] );
 773  
 774  		return true;

PHP Documentation

<?php
/**
	 * Filters whether to override the .mo file loading.
	 *
	 * @since 2.9.0
	 * @since 6.2.0 Added the `$locale` parameter.
	 *
	 * @param bool        $override Whether to override the .mo file loading. Default false.
	 * @param string      $domain   Text domain. Unique identifier for retrieving translated strings.
	 * @param string      $mofile   Path to the MO file.
	 * @param string|null $locale   Locale.
	 */
Quick Info
  • Hook Type: Filter
  • Parameters: 4
  • File: wp-includes/l10n.php
Related Hooks

Related hooks will be displayed here in future updates.