Viewing 3 replies - 1 through 3 (of 3 total)
  • add_action( ‘save_post’, ‘getVendorID’, 10, 3 );

    function getVendorID( $post_ID, $post, $update ) {
    if(($post->post_type==’product’)){
    echo $post->post_author;
    }
    }

    This shows vendor ID

    Cheers ??

    Thanks Maxel. Indeed he is right, Vendors are simply the products author. So, the post_author for any product will return the vendor ID.

    Welcome ??

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘How to get vendor id from product id?’ is closed to new replies.