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.
Related Posts:
- Create custom page in WooCommerce
- WooCommerce – Create Products Programatically [closed]
- How to Use PHP Code In-Page?
- Display featured products by category
- Insert woocommerce products programmatically with featured image and gallery
- Problem with adding programmatically woocommerce product post into category
- Skip in WordPress Post ID’s, can this cause issues?
- How do I change the core post search algorithm? Where is it found/constructed?
- Show posts count for Categories and Tags in wp_nav_menu
- Restore woocommerce orders
- Target only single product page
- Get category slug of the Parent category of a Product
- How to fetch courses in all languages in WordPress?
- How to distinguish pages created by woocommerce?
- Disaply products from category
- Show code only on WooCommerce Pages
- Woocommerce – custom post type of checkout page
- Wp_query WooCommerce products
- How to get only post=’product’
- Stop WP from creating “Sample Page” and “Hello World!” post
- Count how many posts in category
- Custom Single Post By Category
- Post slugs and images cannot have same name?
- Convert custom fields to post categories
- Hide password protected posts in admin
- Most viewed post for the last 2 days using WP_Query
- Adding Post Counts to Menu (Nav) Programmatically?
- This AJAX Code Doesn’t Work – Looking for elegant solution
- Show chart in post using data passed as custom field
- Show One Category on Post
- Show post titles only on the homepage
- Creating new page with pre-defined parent page
- Get all Youtube video’s from posts and embed them on a different page
- How To Add Perfect Apostrophe And Quotation Mark In WordPress Posts?
- Send email to user that his post has been rejected
- How can I highlight syntax like it appears on stackoverflow?
- Custom post type permalinks breaking due to 3.1 bug fix
- wp_insert_post let users post to without login…broke
- Export posts manually selected by end user (not logged in)
- Add Category name to Post Title (h1)
- Blogroll – Different layout for first post
- How to delete old posts’ edits to save space?
- When trashing a post, also trash related comments
- Loop through all product posts?
- Image Insert into posts and pages not working after 3.2.1 update
- Blog Posts not showing title
- How to add Tags Filter in wordpress admin dashboard
- allow new users to post an article before they sign up [closed]
- Make Post Editor Select Number of Columns To 1 By Default
- Display post category in foreach loop with category link
- Adding the_date inside tags around the_content
- Mixing Tweets with Posts
- How to Link to all posts that have the Standard Post Format
- Problem with permalink routing?
- Ajax post filters not working
- Whenever an author saves their post a \" is added next to the double quotation marks
- Making a custom Pagination for multi page blog post
- Listing Specific Categories from Current Post with Depth
- Custom Post Type Rewrite To Include Parent Page(s)
- outputting posts’ taxonomies: cant get ‘get_the_taxonomies’ working
- Disable link for single posts
- related author post thumbnail shows post thumbnail
- Query for first 3 posts to change the look and feel
- Getting blog pagination to work on page set as front page
- How to identify and hide/remove an element from a WordPress page [closed]
- unique post in “$args” of wp_query display more than one post
- New Posts and Pages Won’t Save
- Do one have to wait after pressing “update” on a post edit page?
- Add post tags to previously created custom post type
- Problem with quotes
- Add Input Field in Simple Model Contact Form (smcf) plugin [closed]
- Anyone know a php snippet for showing the first 200 characters of the most recent post?
- Am getting duplicate data from get_posts()
- How to display the post categories for each post inside the loop with custom format?
- Allow / show post comments in category pages
- Filter post by users creation date
- Function is printing twice – any suggestions?
- Pagination Not Working With Custom Post Type Category
- Recent Post Issue
- how to create a category with wp_insert_post and post_category
- Multisite Issue on Subdomain’s article pages
- Extracting the permalink from a post instance
- How to add a block to a category page?
- If user has 1 post then dont let him create new one [closed]
- Show all posts from the tags without having to set all of them
- wordpress display posts by terms id or name
- Is there a global page/post/product/anything ID?
- Auto populate custom fields by post date
- Query post by meta key of another table
- Thumbnail With Next/Prev Links Not Showing Next Post?
- Sort Posts Alphabetically by Multiple Categories [duplicate]
- Trying to display stick or featured post on homepage
- Single post page from static home not working
- How can I allow users (subscribers) to download selected posts into a single PDF? (RESOLVED)
- How to change text (date) in post base on the day
- Limit amount of pages shown in pagination within wp_query
- How do you order posts by type then term_id and then by date?
- Blog posts are not appearing as subs of Blog Page
- Change permalinks in posts via SQL
- Only an admin can add new tags