load_textdomain_mofile
Filter HookDescription
Filters MO file path for loading translations for a specific text domain.Hook Information
File Location |
wp-includes/l10n.php
View on GitHub
|
Hook Type | Filter |
Line Number | 795 |
Hook Parameters
Type | Name | Description |
---|---|---|
string
|
$mofile
|
Path to the MO file. |
string
|
$domain
|
Text domain. Unique identifier for retrieving translated strings. |
Usage Examples
Basic Usage
<?php
// Hook into load_textdomain_mofile
add_filter('load_textdomain_mofile', 'my_custom_filter', 10, 2);
function my_custom_filter($mofile, $domain) {
// Your custom filtering logic here
return $mofile;
}
Source Code Context
wp-includes/l10n.php:795
- How this hook is used in WordPress core
<?php
790 * @since 2.9.0
791 *
792 * @param string $mofile Path to the MO file.
793 * @param string $domain Text domain. Unique identifier for retrieving translated strings.
794 */
795 $mofile = apply_filters( 'load_textdomain_mofile', $mofile, $domain );
796
797 if ( ! $locale ) {
798 $locale = determine_locale();
799 }
800
PHP Documentation
<?php
/**
* Filters MO file path for loading translations for a specific text domain.
*
* @since 2.9.0
*
* @param string $mofile Path to the MO file.
* @param string $domain Text domain. Unique identifier for retrieving translated strings.
*/
Quick Info
- Hook Type: Filter
- Parameters: 2
- File: wp-includes/l10n.php
Related Hooks
Related hooks will be displayed here in future updates.