How to Get Linked Elements for a specific ml_source_elementid

I’m using MultiLingualPress* on one of my pages, which is multisite, multilingual.

I am trying to get the permalink of a page based on two things:

1) The ml_source_elementid, which identifies the grouping of pages. (i.e. About Us (EN), Sobre Nos (PT)). This I know ahead of time. In this case it is 92.

2) The current language. This I can do by calling

mlp_get_current_blog_language(true);

I have been able to get the permalink using the WordPress general

<?php
$url = get_the_permalink(92);
$current_lang = mlp_get_current_blog_language(true);
$ml_permalink = apply_filters(‘ml_permalink’, $url , $current_lang );
echo $ml_permalink
?>

Any idea if I can apply these sorts of filters to get the link? Or is there a better way to do this?

Thanks!!

*https://multilingualpress.org

Read more here:: How to Get Linked Elements for a specific ml_source_elementid

Leave a Reply

Your email address will not be published. Required fields are marked *