I'd like to have the backend of Wordpress in English and use a different locale for the frontend

so far I figure out perhaps I could do it by setting in the wpconfig the locale I want to use in the frontend, then add in functions.php something like this:

add_filter('locale', 'mytheme_backendlocale');
function mytheme_backendlocale($locale) {
    if ( is_admin() ) {
        return 'en_US';
    }
    return $locale;
}

is this the best practice to achieve what I want or should I do it differently?

没有正确的解决方案

许可以下: CC-BY-SA归因
scroll top