Support » Plugin: Polylang » Sharing custom taxonomy (without translating it)

  • Hi,
    I want my custom post type (trip) to use the same taxonomy (destination) between languages.
    I don’t want the taxonomy to be transalated.
    So, when I create a new post, in any language, I can select taxonomy from the same list.

    I tried to set my taxonomy as “not translated” with wpml-config.xml, and I got only the following effect: in my “Custom post types and Taxonomies” settings, the taxonomy has disappeared.
    Anyway, when I create a new post in different languages (except the main one), my taxonomy list is empty.
    Moreover, when I go to the taxonomy page, I can actually translate the taxonomy.

    Thanks in advance for any help.

Viewing 1 replies (of 1 total)
  • Thread Starter attiliok

    (@attiliok)

    I found a workaround, but I think there is something wrong in the logic.
    I solved putting this on my functions.php file

    add_filter( 'pll_get_taxonomies', 'add_tax_to_pll', 10, 2 );
     
    function add_tax_to_pll( $taxonomies, $is_settings ) {
            unset( $taxonomies['<strong>my_tax</strong>'] );
        return $taxonomies;
    }

    Please consider that my taxonomy name is DESTINATION, but anyway I had to put exactly “my_tax” inside the UNSET function.
    If your taxonomy is not the first one, you will have to use “my_tax2” or “my_tax3”.
    This is very strange in my opinion, probably I’m missing something o there is something wrong on the filter.

    Anyway, as for now, I solved.

Viewing 1 replies (of 1 total)
  • The topic ‘Sharing custom taxonomy (without translating it)’ is closed to new replies.