widgets - Form link throwing website to main language

So this theme (Listeo) I'm using it's not natively multilang, so support doesn't help on this and I had t

So this theme (Listeo) I'm using it's not natively multilang, so support doesn't help on this and I had to make some customization in the code. Every time I'm on the second language (English), and I press a link in the costumer dashboard, it'll open that page but in the main language.

I was able to temporarily fix those menus in this personalized dashboard using this:

- Daclared this (found it on google)

    $icl_object_id = icl_object_id($dashboard_page, 'page', true);

- And for the links this

    <a href="<?php echo get_permalink($icl_object_id); ?>"><?php esc_html_e('Dashboard','listeo');?></a>

But I'm not being able to fix it in a widget form. If I press the button called "Request Booking" it sends me to the correct page but in a different language (Main one = Portuguese).

The code in this form is the following:

    <input type="hidden" id="listing_type" value="<?php echo $post_meta['_listing_type'][0]; ?>" />
    <input type="hidden" id="listing_id" value="<?php echo $post_info->ID; ?>" />

    <input id="booking" type="hidden" name="value" value="booking_form" />
    <?php if(is_user_logged_in()) :
        if ($post_meta['_listing_type'][0] == 'event') { 
            $book_btn = esc_html__('Make a Reservation','listeo_core'); 
        } else { 
        if(get_post_meta($post_info->ID,'_instant_booking', true)){
            $book_btn = esc_html__('Book Now','listeo_core');   
        } else {
            $book_btn = esc_html__('Request Booking','listeo_core');    
        }
    }  ?>

    <a href="#" class="button book-now fullwidth margin-top-5"><div class="loadingspinner"></div><span class="book-now-text"><?php echo $book_btn; ?></span></a>

Any idea how can I make this call the requested options but keeping in the selected language?

I'm using latest wordpress version, polylang and loco translate. Thank you in advance.

发布者:admin,转转请注明出处:http://www.yc00.com/questions/1744937248a4602100.html

相关推荐

  • widgets - Form link throwing website to main language

    So this theme (Listeo) I'm using it's not natively multilang, so support doesn't help on this and I had t

    2天前
    80

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信