load_textdomain
Action HookDescription
Fires before the MO translation file is loaded.Hook Information
File Location |
wp-includes/l10n.php
View on GitHub
|
Hook Type | Action |
Line Number | 785 |
Hook Parameters
Type | Name | Description |
---|---|---|
string
|
$domain
|
Text domain. Unique identifier for retrieving translated strings. |
string
|
$mofile
|
Path to the .mo file. |
Usage Examples
Basic Usage
<?php
// Hook into load_textdomain
add_action('load_textdomain', 'my_custom_function', 10, 2);
function my_custom_function($domain, $mofile) {
// Your custom code here
}
Source Code Context
wp-includes/l10n.php:785
- How this hook is used in WordPress core
<?php
780 * @since 2.9.0
781 *
782 * @param string $domain Text domain. Unique identifier for retrieving translated strings.
783 * @param string $mofile Path to the .mo file.
784 */
785 do_action( 'load_textdomain', $domain, $mofile );
786
787 /**
788 * Filters MO file path for loading translations for a specific text domain.
789 *
790 * @since 2.9.0
PHP Documentation
<?php
/**
* Fires before the MO translation file is loaded.
*
* @since 2.9.0
*
* @param string $domain Text domain. Unique identifier for retrieving translated strings.
* @param string $mofile Path to the .mo file.
*/
Quick Info
- Hook Type: Action
- Parameters: 2
- File: wp-includes/l10n.php
Related Hooks
Related hooks will be displayed here in future updates.