Skip to main content

Follow the show’s language, with your own default when the podcaster has not set one

Free Beginner

A show’s Language can be Not set, and its feed still says en-us then. If your add-on picks a language from the show, ask benecaster_get_show_language() for the raw choice, so an unset show gets your default rather than English.

Code

<?php
function my_addon_language_for( int $show_id ): string {
    $chosen = benecaster_get_show_language( $show_id, true ); // '' when Not set

    return '' !== $chosen ? $chosen : 'auto'; // your own default, e.g. auto-detect
}

View on GitHub →

Need this built rather than just documented? See our services →