Menu Adam R Brown

WP hooks navigation: Home/browse • Actions index • Filters index

Source View: load_translation_file

To save our bandwidth, we show only a snippet of code around each occurence of the hook. View complete file in SVN (without highlighting).

Understanding Source Code

The best way to understand what a hook does is to look at where it occurs in the source code.

Remember, this hook may occur in more than one file. Moreover, the hook's context may change from version to version.

Source View

Line Code
834            * the file path could be for an MO or PHP file.
835            *
836            * @since 6.5.0
837            * @since 6.6.0 Added the `$locale` parameter.
838            *
839            * @param string $file   Path to the translation file to load.
840            * @param string $domain The text domain.
841            * @param string $locale The locale.
842            */
843           $file = (string) apply_filters( 'load_translation_file', $file, $domain, $locale );
844
845           $success = $i18n_controller->load_file( $file, $domain, $locale );
846
847           if ( $success ) {
848                if ( isset( $l10n[ $domain ] ) && $l10n[ $domain ] instanceof MO ) {
849                     $i18n_controller->load_file( $l10n[ $domain ]->get_filename(), $domain, $locale );
850                }
851
852                // Unset NOOP_Translations reference in get_translations_for_domain().