• Resolved urukai

    (@urukai)


    I’ve got a custom taxonomy “product_group”, with linked translations for all languages.

    There’s a function called “mlp_get_linked_elements()”, I tried something like:

    // Get the german version of a term, in the current blog
    $german_term = get_term_by( 'slug', 'Bücher', 'product_group' );
    // Trying to find the term in other languages, but this doesn't seem to be working
    $other_versions = mlp_get_linked_elements( $german_term->ID, 'product_group' );

    How can I get an linked term in another language?

Viewing 2 replies - 1 through 2 (of 2 total)
  • Hi there,

    what exactly do you want to have?

    The mlp_get_linked_elements() function is the appropriate way to get the IDs of all related content elements. For terms, this works by using the term taxonomy ID (and not the term ID). The type is not the taxonomy slug, but 'term'.

    So, this would be the according code:

    $term = get_term_by( 'slug', 'some-slug-here', 'some-taxonomy-here' );
    $related_terms = mlp_get_linked_elements( $term->term_taxonomy_id, 'term' );

    Does this help?

    Best regards,
    Thorsten

    Thread Starter urukai

    (@urukai)

    Yes! That helped! Thanks a lot!

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Find Translation for Linked Term of Custom Taxonomy’ is closed to new replies.