WordPress.org

Ready to get started?Download WordPress

Forums

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

  1. sireneweb
    Member
    Posted 1 year ago #

    Hi,
    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.

    http://wordpress.org/extend/plugins/cpt-onomies/

  2. Piet
    Member
    Posted 1 year 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
    Member
    Posted 1 year ago #

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

    Normaly,
    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
    Member
    Posted 1 year 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
    Member
    Plugin Author

    Posted 1 year 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.

    Thanks!

  6. creativexperience
    Member
    Posted 1 year ago #

    Well i try but no effect

  7. Piet
    Member
    Posted 1 year 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

Tags

No tags yet.