In this case, Forms Commerce is used to submit multiple posts with the same Order. The Form setting indicates that the post should be published when the Order is completed. However, only one post will be published automatically due to a limitation in the Forms Commerce system. Only one post is expected per Order, so only the newest post will be published when the Order is completed.
To automatically publish all posts connected with the Order, a custom code snippet is required:
// publish all posts created when one commerce form is submitted mutliple times in the same order add_action( 'cred_commerce_after_order_completed', 'publish_all_ordered_posts', 10, 1 ); function publish_all_ordered_posts( $data ) { // which order was completed? $order_id = $data['transaction_id']; // which posts were created in this order? $all_order_posts = get_post_meta( $order_id, '_cred_post_id'); // loop over all the created posts if( !is_array( $all_order_posts ) ) return; foreach( $all_order_posts as $all_order_post ) { // check the post status $this_post_status = get_post_status( $all_order_post ); // publish any unpublished posts if ( $this_post_status != 'publish' ) { $args = array( 'ID' => $all_order_post, 'post_status' => 'publish' ); wp_update_post( $args ); } } }