do_action( 'load_textdomain', string $domain, string $mofile )

Fires before the MO translation file is loaded.


Parameters

$domain string
Text domain. Unique identifier for retrieving translated strings.
$mofile string
Path to the .mo file.

Top ↑

Source

File: wp-includes/l10n.php. View all references

do_action( 'load_textdomain', $domain, $mofile );


Top ↑

Changelog

Changelog
Version Description
2.9.0 Introduced.

Top ↑

User Contributed Notes

  1. Skip to note 1 content
    Contributed by Codex

    Example:

    /**
     * Example of load_textdomain usage
     * @param string $domain Unique domain for translation.
     * @param string $mofile Path to the .mo file.
     * @param array|string $args Optional args used in taxonomy registration.
     */
    function log_mo_file_load($domain, $mofile){
        echo 'loading file "' . $mofile . '" on domain "' . $domain . '"';
        // or whatever else you'd like to do here.
    }
    
    add_action( 'load_textdomain', 'log_mo_file_load' );

You must log in before being able to contribute a note or feedback.