do_action( ‘load_textdomain’, string $domain, string $mofile )

Fires before the MO translation file is loaded.

Parameters

$domainstring
Text domain. Unique identifier for retrieving translated strings.
$mofilestring
Path to the .mo file.

Source

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

Changelog

VersionDescription
2.9.0Introduced.

User Contributed Notes

  1. Skip to note 2 content

    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.