Skip to main content

Add or remove languages offered in Settings and the setup wizard

Free Beginner Since v1.0.0

Benecaster ships with a curated set of languages available in the Settings → Language tab and the setup wizard’s language picker. This filter lets you extend or trim that list.

The two most common reasons to use it: you’ve shipped a translation that isn’t included out of the box and want it to appear as a selectable option, or you’re running a multilingual site but only support certain languages and want to keep the picker focused.

Each entry needs a WordPress locale code (like es_AR), an English display name, and the language’s name written in that language. Use valid WordPress locale codes — the value flows through to locale-keyed email templates and subscriber records.

Code

<?php
add_filter( 'benecaster_available_locales', function ( array $locales ): array {
    $locales[] = [
        'code'         => 'es_AR',
        'english_name' => 'Spanish (Argentina)',
        'native_name'  => 'Español (Argentina)',
    ];
    return $locales;
} );

Hooks Used