WC products are posts themselves, so you could use:
add_action('publish_post', 'wpse_publish_post_with_product');
Within the new function, you’d have a check for post_type
. If the post_type
that was just published is a WC product, then grab the image and description from that post, and use wp_insert_post()
to publish a Post with the same info.
Side note: I’m not sure what your goal is with publishing a Post in addition to a Product. Since both URLs will contain roughly the same information, you’re likely to run into SEO problems with duplicate content. If you could elaborate on your goal, there might be a better, more SEO-friendly way to achieve it.