CPT-onomies: Using Custom Post Types as Taxonomies
Bug with taxomony in manager.php (7 posts)

  1. sireneweb
    Posted 3 years ago #

    i found a bug with your plugin and WPML at line 329 in manager.php when you have a blog and create sub category for post.

    In fact, when you are at the base, the blog list all posts related to main and sub categories because CPT can't find the posts in others languages.

    For example :
    Primary langage FR
    AND ( cpt_onomy_tt1.term_taxonomy_id IN (5,6,7,8,9)

    Secondary langage EN
    AND ( cpt_onomy_tt1.term_taxonomy_id IN (5)

    The bug comes from $new_where[] = $taxonomies[ 'where' ][] = "$alias.term_taxonomy_id $operator ($terms)";

    Maybe can you help me to find a good solution for this.


  2. Piet Bos
    Posted 3 years ago #

    usually with WPML you need to use the icl_object_id() function to get the ID of the post/page/cpt/category/tag you want in both languages.

    I am not familiar with the cpt-onomies plugin, but I can imagine you would need something in the lines of:

    cpt_onomy_tt1.term_taxonomy_id IN ( icl_object_id( array(5,6,7,8,9), x, false ) )

    where x is the cpt or taxonomy (not clear from your code)

  3. creativexperience
    Posted 3 years ago #

    Yeah exactly, cpt_onomy_tt1.term_taxonom_id doesn't find all taxomoy_id

    i must get this for French langauge
    AND ( cpt_onomy_tt1.term_taxonomy_id IN (5,6,7,8,9)

    and for English language
    AND ( cpt_onomy_tt1.term_taxonomy_id IN (12,13,14,15,16)
    but with CPT i get this
    AND ( cpt_onomy_tt1.term_taxonomy_id IN (12)

    That's why it's strange. I translate all my categories in two languages

  4. Piet Bos
    Posted 3 years ago #

    as I tried to explain above, to get any sort of ID for both languages in WPML you must use the function icl_object_id().
    More info on that via http://wpml.org/documentation/support/creating-multilingual-wordpress-themes/language-dependent-ids/ or you can contact me for a WPML Consult via http://senl.in/gBbL96

  5. Rachel Carden
    Plugin Author

    Posted 3 years ago #

    Hey guys. Wow. Let me get this next update out so I can get a few bug fixes and small things out of the way and then I will try my best to wrap my head around WPML.

    If you come up with a solution in the meantime, please let me know.


  6. creativexperience
    Posted 3 years ago #

    Well i try but no effect

  7. Piet Bos
    Posted 3 years ago #

    @Rachel perhaps this tool can help you in the right direction: http://wpml.org/2012/10/new-wpml-tool-speeds-up-theme-compatibility-conversion/

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic


No tags yet.