Make WordPress Core


Ignore:
Timestamp:
05/04/2024 05:25:54 PM (2 years ago)
Author:
johnbillion
Message:

I18N: Pass the $locale variable to the load_translation_file filter.

This avoids the need for the locale to be recalculated by code that hooks into this filter.

Props swissspidy, mukesh27, johnbillion

Fixes #61108

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/l10n.php

    r58062 r58095  
    834834                 *
    835835                 * @since 6.5.0
     836                 * @since 6.6.0 Added the `$locale` parameter.
    836837                 *
    837838                 * @param string $file   Path to the translation file to load.
    838839                 * @param string $domain The text domain.
     840                 * @param string $locale The locale.
    839841                 */
    840                 $file = (string) apply_filters( 'load_translation_file', $file, $domain );
     842                $file = (string) apply_filters( 'load_translation_file', $file, $domain, $locale );
    841843
    842844                $success = $i18n_controller->load_file( $file, $domain, $locale );
Note: See TracChangeset for help on using the changeset viewer.