• Resolved Riccardo79

    (@riccardo79)


    I’ve installed CPTUI on wordpress on my PC for development purposes.
    I created a CPT and a Custom Taxonomy, attached to the CPT.
    My problem is that each time I update a custom post, it is created a new Taxonomy entry (with a number instead of the name), and is set by default.
    Did anyone have this problem and how got to solve it?

    Thanks,
    Riccardo

Viewing 9 replies - 1 through 9 (of 9 total)
  • Plugin Contributor Michael Beckwith

    (@tw2113)

    The BenchPresser

    That’s a new one to me, at least as far as I can recall.

    Since it’s a dev site, can you test the behavior with all other plugins disabled and one of the WP core default themes active? The idea is to narrow down exactly what may be doing the processing behind the scenes. CPTUI itself shouldn’t be creating terms at all, so my best guess is that it’s something else.

    Thread Starter Riccardo79

    (@riccardo79)

    Hello Michael, thanks for your reply.
    It’s a fresh installation of WP with just CPTUI activated. It’s WP 5.0 beta 3, but I noticed the same behaviour with a stable release too.
    CPTUI is v. 1.6.0.

    I looked into the database, in the table wp_terms, I created 3 terms (for example):
    Term1 (term_id = 2)
    Term2 (term_id = 3)
    Term3 (term_id = 4)

    If I create a post and assign it to “Term1”, when I publish it, it is assigned to a new term “2” with term_id=5. If I update the post, it is assigned to a new term “5” with term_id=6, and so on…
    It seems that each time it creates a new term equal to the term_id of the previous term.

    Hope this helps you.
    Thanks

    • This reply was modified 6 years, 3 months ago by Riccardo79.
    Plugin Contributor Michael Beckwith

    (@tw2113)

    The BenchPresser

    Would you be willing to do one more test, and see if the behavior occurs with version 1.5.8?

    You can acquire a copy of that over at https://www.ads-software.com/plugins/custom-post-type-ui/advanced/ at the bottom.

    Shouldn’t need to do any sort of database level reversions, at least none I can think of offhand.

    If it’s still occurring with that version, then I have to suspect something going on with the site itself, if it’s not on 1.5.8 and is on 1.6.0, then it’s potentially us, though I don’t have any leads on why yet, at the moment.

    Thread Starter Riccardo79

    (@riccardo79)

    It seems that 1.5.8 is working fine, but in this version, the custom taxonomy has the tag meta box, while in 1.6.0 I’m using the category meta box.
    In the older version, in the “Edit taxonomy” page there is not the “Metabox callback” text box to change it.

    Plugin Contributor Michael Beckwith

    (@tw2113)

    The BenchPresser

    Are you creating a custom callback for rendering your taxonomy metabox? That could definitely be playing a part in things, and one that I wouldn’t have had a way of knowing about. Would be willing to look over that callback code for you.

    It also has me curious why you needed to provide one, as it sounds like you maybe just wanted the checkbox version of term assignment. That’s able to be done simply by making your taxonomy hierarchical.

    If that’s all you want, you could probably ditch the callback and just go with that setting. Regardless, I am curious about the callback code.

    Thread Starter Riccardo79

    (@riccardo79)

    No, I didn’t provide any callback.
    In the textbox of “Metabox callback” I set: post_categories_meta_box, but I didn’t write any extra code.
    I did this because I prefer to have a checkbox interface, but I could revert to the tags meta box.

    Plugin Contributor Michael Beckwith

    (@tw2113)

    The BenchPresser

    Ahh.

    Yeah, I’d re-update back to 1.6.0 and then remove that setting for the callback. Then go to the “hierarchical” dropdown and make sure that’s set to true for your taxonomy. You should be golden at that point.

    Thread Starter Riccardo79

    (@riccardo79)

    It worked!
    Thank you very much for your support!

    Plugin Contributor Michael Beckwith

    (@tw2113)

    The BenchPresser

    Welcome ??

Viewing 9 replies - 1 through 9 (of 9 total)
  • The topic ‘CPT creates new taxonomy entry on each update’ is closed to new replies.