Convert Plus WPMl function

hi!
I’ve read in the following post (https://theme.co/apex/forum/t/is-convertplus-compatible-with-wpml-how-to-translate/24945) that a function can be added to display pop ups in different languages, i`ve followed the post instructions, but instead of 2 languages i have 3, so i tried the following code but didn’t work, it displays always english.

function cp_callback_function( $display, $style_id ) {
     
        if( $style_id == 'my_id_en' && ICL_LANGUAGE_CODE == 'en') return true;
        if( $style_id == 'my_id_de' && ICL_LANGUAGE_CODE == 'de') return true;
        if( $style_id == 'my_id_es' && ICL_LANGUAGE_CODE == 'es') return true;

    return $display;

}
add_filter( 'cp_target_page_settings', 'cp_callback_function', 10, 2 );

Could you help me?
Thank in advance!

Hi @mallorcanetworks,

Thanks for reaching out.

It should work, perhaps it’s style ID related and it doesn’t match? Please provide your site’s URL and admin login credentials in the secure note and I’ll check. And a sample URL where the popup should be displayed.

Thanks!

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.