Cannot set Item parent when creating a new Item

[ad_1]

The WPInv_Item ‘s data store always uses 0 as the parent’s ID when creating a new Item, ignoring any parent ID set using set_parent_id . This means that the item must first be saved, in order to get a non-0 ID, then the parent needs to be set and the item saved again. Is there a reason why the parent ID cannot be passed to the call to wp_insert_post so that an item can be created with a given parent all at once?

 

This site will teach you how to build a WordPress website for beginners. We will cover everything from installing WordPress to adding pages, posts, and images to your site. You will learn how to customize your site with themes and plugins, as well as how to market your site online.

Buy WordPress Transfer