Snippets

Merkulove Team Filter for managing multilang-locale in Speaker WordPress plugin

Created by Dmitry Merkulov
if ( ! function_exists( 'speaker_multilang_locale' ) ) {
    /**
     * Retrieves the multilingual locale for the speaker.
     *
     * @param string $locale The original locale of the speaker.
     * @param int $post_id The WordPress Post ID.
     *
     * @return string The multilingual locale of the speaker.
     */
    function speaker_multilang_locale( string $locale, int $post_id ): string
    {
        // Do something with the $locale
        // Use the $post_id to get the locale from the post meta or any other source

        return $locale;
    }
}
add_filter( 'speaker_multilang_locale', 'speaker_multilang_locale' );

Comments (0)

HTTPS SSH

You can clone a snippet to your computer for local editing. Learn more.