Home Forums WC Vendors Pro Support wcv_save_product hook

NOTICE: We've Moved to a Ticket System for Support

As of August 31, 2017 (12am EST) our support forums will be retired (read-only), and we will be moving to a support ticket system.  This will allow us to better organize and answer support requests, and provide a more personalized experience as we assist our customers.

For the time being, we will leave our forums open for reading and learning while we work on creating a more robust Knowledge Base for everyone to use.

If you are a WC Vendors Pro customer please open a support ticket here. 

If you are a WC Vendors user please open a support ticket on the Wordpress.org forums.

The information on this forum is outdated and in most instances no longer relevant. Please be sure to check our documentation for the most up to date information.


Thank you to all of our customers!


Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
  • #59683


    I was wondering if you could help. I may be using the wcv_save_product hook incorrectly… I have registered a custom taxonomy for the product post type, named ‘product_gender’. I have managed to successfully display this in the Pro dashboard product edit page beneath the category selection by calling this custom function from the product-edit.php template:

    function prefix_form_gender( $object_id ) {
    WCVendors_Pro_Form_helper::select2( array(
    ‘post_id’ => $object_id,
    ‘id’ => ‘product_gender[]’,
    ‘class’ => ‘select2’,
    ‘label’ => __(‘Gender’, ‘jotu’),
    ‘show_option_none’ => __(‘Select Gender’, ‘jotu’),
    ‘taxonomy’ => ‘product_gender’,
    ‘capabilities’ => ‘manage_product’,
    ‘taxonomy_args’ => array(
    ‘hide_empty’ => 0,


    All working fine up to this point. I am able to save the selection of the custom taxonomy when editing an already existing product. I have accomplished this with the below:

    add_action( ‘init’, ‘process_tax_save’ );
    function process_tax_save() {
    if( isset( $_POST[‘product_gender’] ) && isset( $_POST[‘post_id’] ) ) {
    $term = $_POST[ ‘product_gender’ ];
    $id = (int) $_POST[‘post_id’];
    wp_set_object_terms( $id, (int)$term[0], ‘product_gender’ );


    My issue seems to be when creating a brand new product. When creating a new product, I seem unable to save the custom taxonomy. I am using the wcv_save_product hook for this, which as I understand, should run on post save, correct? Below is my code so far for the addition of new products:

    function save_caracteristica( $post_ID ){
    $term = $_POST[ ‘product_gender’ ];
    wp_set_object_terms( (int) $post_ID, (int)$term[0], ‘product_gender’ );
    add_action( ‘wcv_save_product’, ‘save_caracteristica’, 10, 1 );


    I have tried countless variations of this. I have tried using te ‘save_posts’ hook, as well as modifying the priority. After spending a good number of hours on this, searching through the forums etc. I figured you may be able to point me in the right direction? I am thinking I may need to use a different hook, perhaps I am using wcv_save_product incorrectly?

    Please note, this website is being developed locally.




    In version 1.4 I’ve added auto save code so that if you prefix your fields with a _wcv_custom_taxonomy. If you can’t wait till 1.4 is out here is example code that works for display and saving on the product edit form.




Viewing 2 posts - 1 through 2 (of 2 total)
  • The forum ‘WC Vendors Pro Support’ is closed to new topics and replies.