• Resolved birdhousedigital

    (@birdhousedigital)


    Hi. I’m using Unlimited Post Types to create a custom taxonomy for WooCommerce. I need the taxonomy to also query the post type “product_variation” as well as “product”. Is this possible with this plugin?

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author wpexplorer

    (@wpexplorer)

    Hi,

    This is AJ the plugin author. Do you mean you want to assign the taxonomy to the “product_variation” post type under here? https://a.cl.ly/Qwu5x9lO

    If so, unfortunately it’s not possible by default because the product_variation post type is not “public” by default (see the codex).

    You would either need to hook into “woocommerce_taxonomy_args_product_visibility” to make the product_variation post type public or you would need to assign it to the post type using some code like this:

    add_action( 'init', function() {
        register_taxonomy_for_object_type( 'YOUR_TAX', 'product_variation' );
    } );

    See CODEX

    I believe that should work, but not 100% sure.

    – AJ

    Thread Starter birdhousedigital

    (@birdhousedigital)

    Okay cool, that makes sense.
    Thanks so much for your answer.

    Plugin Author wpexplorer

    (@wpexplorer)

    No problem. Also just realized who you were. Thank you again for being such a great Total customer!

    Let me know if I can help with anything else also if you prefer for any Post Types Unlimited related questions you can leave them on Themeforest in the Total comments if you prefer over using this forum.

    Thread Starter birdhousedigital

    (@birdhousedigital)

    Thanks AJ. Great to know I can ask questions about this in the TF Total comments in the future!

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Custom Taxonomy for WooCommerce’ is closed to new replies.