[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?
