Make WordPress Core

Ticket #49356: user_locale_filter_49356.patch

File user_locale_filter_49356.patch, 511 bytes (added by vanaf1979, 4 years ago)
  • wp-includes/l10n.php

    diff --git a/wp-includes/l10n.php b/wp-includes/l10n.php
    index 4559263edb..46ec621dc3 100644
    a b function get_user_locale( $user_id = 0 ) { 
    102102        }
    103103
    104104        if ( ! $user ) {
    105                 return get_locale();
     105                return apply_filters( 'user_locale', get_locale() );
    106106        }
    107107
    108         $locale = $user->locale;
    109         return $locale ? $locale : get_locale();
     108        $locale = $user->locale ? $user->locale : get_locale();
     109        return apply_filters( 'user_locale', $locale );
    110110}
    111111
    112112/**