How to add product in woocommerce with php code [closed]

Question

I want to add products with PHP code like below:

$post_information = array(
  'post_title' => 'new item shop',
  'post_content' => 'this is new item shop',
  'post_type' => 'post',
  'post_status' => 'publish'
);
$post_id = wp_insert_post($post_information);

but this code optimize for WooCommerce such as post type and guid and metadata and… Can someone help?

0
, Hossein Hashemi 3 years 2020-04-04T04:52:04-05:00 0 Answers 83 views 0

Leave an answer

Browse
Browse