For now, lets talk about the "Gallery" tab as whatever method or correction will be applied it will be applied to all other tab/forms.
I see you created the following XYZ Gallery forms:
XYZ gallery Add form:
- hidden link
Where:
I see you set the post status to pending.
I've added hidden custom field and given the slug "@trial-xyzs.parent" and its default value will be "[wpv-post-id]" so as soon as you submit the entry the post will be attached to current trial event post.
I've also added hidden field that will hold the "post_title" and given the default value as "[wpv-post-id]-[wpv-current-user field='ID']". You can check the above form.
XYZ gallery Edit form:
- hidden link
Where:
I've removed the "post_title" field as it was not required and I've set the above form's post statue to "Keep Original Status"
I've created the following view "check-current-user-xyz-posts"
=> hidden link
Where:
I've added the following "Query Filters":
Post author filter
Select posts with the author the same as the current logged in user.
Post status filter
Select posts with status of publish or pending or private.
The above view will try to get the post ID for the current loggedin user for the XYZ post type and if there is no post found it will return 0. As you can see the "Loop Editor" section is code is adjusted as given under:
[wpv-layout-start][wpv-items-found]<!-- wpv-loop-start --><wpv-loop>[wpv-item index=other][wpv-post-id],[wpv-item index=last][wpv-post-id]</wpv-loop><!-- wpv-loop-end -->[/wpv-items-found][wpv-no-items-found]0[/wpv-no-items-found][wpv-layout-end]
Now, I've created the following content template that will be used to display under the "Gallery" tab namely "ct-for-gallery-tab":
=> hidden link
[wpv-conditional if="( '[wpv-view name='check-current-user-xyz-posts' cached='off']' eq '0' )"]
showing add form
[cred_form form="xyz-gallery"]
[/wpv-conditional]
[wpv-conditional if="( '[wpv-view name='check-current-user-xyz-posts' cached='off']' ne '0' )"]
showing edit form
[cred_form form='xyz-edit' post="[wpv-view name='check-current-user-xyz-posts' cached='off']"]
[/wpv-conditional]
As you can see I used the conditional shortcode where I'm displaying the "XYZ" post type add form if there is no post found for the current user.
In case of current user has XYZ post - then we will display the edit post and to determine what is the post ID to edit XYZ post entry for the current user - it will be returned by view:
post="[wpv-view name='check-current-user-xyz-posts' cached='off']"
At last, with your Elementor template, I've removed the Toolset form module you added and instead I've added the shortcode module and inside the shortcode module I've added the content template that we created for the gallery "ct-for-gallery-tab":
=> hidden link
[wpv-post-body view_template="ct-for-gallery-tab"]
Now, we have this setup for "Gallery" tab, if user loggedin and there is no XYZ post form for that user, it will display the XYZ add form to add gallery items and if there is post found for the current user it will display the edit form to Edit the gallery items for XYZ post.
Can you please confirm first this much works and then we can take step forwared.