get_adjacent_post by language

To use get_adjacent_post you have exclude all the term id of that specific taxonomy, For polylang your texonomy is language, First you have retrieve all term ids of indivual languages, and then exclude all of them other than the one you want.

    global $post;
    $post_id = [XXXX]; // any specific post id 
    $post = get_post($post_id);
    //get all the tems of language taxonomy 
    $terms = get_terms( 'language', array(
        'hide_empty' => false,
    ) );
    $excludeds_term_ids = array();
    foreach($terms as $term){
        if($term->slug !='en'){   // exlude all of them other than 'en'
            $excludeds_term_ids[]= $term->term_id; 
        }
    }
    
    
    $next_post = get_adjacent_post(true,$excludeds_term_ids,false,'language');
    echo $next_post->ID;