Support » Plugin: Require Post Category » Use of require post category with CPT-onomies (use of CPT as taxonomy)

  • Resolved alixNL

    (@alixfresson)


    Hi,
    Thanks for the plugin, I tried it on a custom post type and that works fine with the taxonomies. Nevertheless, one of my taxonomy is in fact a custom post type (I use the plugin CPT-onomies (https://wordpress.org/plugins/cpt-onomies/), and with that one, I can not figure out how to make the require post category work… Could you help me please?
    Thanks!

Viewing 6 replies - 1 through 6 (of 6 total)
  • Plugin Author Josh Hartman

    (@joshhartman)

    I’ll check it out. It should work fine with it as long as CPT-onomies is using the native editor (Classic or Gutenberg) and the native methods to register WordPress custom post types and taxonomies.

    Thread Starter alixNL

    (@alixfresson)

    Thanks a lot Josh for looking into it. I am sorry I am new to php and wordpress coding so I am still missing a lot and I am not sure if CPT-onomies uses the proper methods. Here is the documentation for CPT-onomies https://web.archive.org/web/20161120053837/http://wpdreamer.com/plugins/cpt-onomies/documentation/
    On my Custom Post Type I can use your Plugin and it works well for my other taxonomies. But I can’t make it work for the CPT-onomy.
    Looking forward to reading you, thanks again!

    Plugin Author Josh Hartman

    (@joshhartman)

    Okay, I see what it is now. “… allows you to use your custom post type in the same manner as a taxonomy, using your post titles as the terms. This is what we call a ‘CPT-onomy’.”

    And I can see that it is creating a custom metabox for its “CPT-onomy”. This is the main reason it won’t work with the JavaScript I’ve written for the Classic Editor; the box id doesn’t follow the naming of native taxonomies.

    And these psuedo-taxonomies aren’t registering themselves with the REST API, so I can’t access them through the post object in Gutenberg.

    Since this isn’t the native way to create a custom taxonomy in WordPress, no, it will not work with Require Post Category.

    Now, it is certainly possible to do what you want by programming something specific for the CPT-onomies plugin, but it is outside the scope of the Require Post Category plugin.

    Thread Starter alixNL

    (@alixfresson)

    Oh, too bad, ok, thanks for taking the time to answer my question though! And if you have any link, or direction to advise me in order to go further with what I want to achieve, please, let me know!

    Plugin Author Josh Hartman

    (@joshhartman)

    Yes, if you are using the Classic Editor it shouldn’t be too difficult to accomplish. I would suggest you look at the JavaScript I’m using in this plugin you’ll see how I’m looking at the container and determining if there are categories checked or tags added to their respective container.

    You’d need to learn the structure of the CPT-onomy meta box and then you can use jQuery functions and logic to determine if the user has populated your box.

    For Gutenberg it would require a lot of work to get it to work for it to show up in the post object as a taxonomy. I don’t know enough about Gutenberg development to even tell you how to do that.

    Thread Starter alixNL

    (@alixfresson)

    Thank you very much, I’ll have a try!

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Use of require post category with CPT-onomies (use of CPT as taxonomy)’ is closed to new replies.