Tell us what you are trying to do?
I'm creating an Online Menus site, where bar and restaurants can create their own profile and add their menus.
To project this I'm using Blocks addon.
I have created 3 different CPTs: Restaurants, Menus, and Allergens. Where Restaurants CPT has a one-to-many relationship with Menu CPT, and Menu CPT has many-to-many relationships with Allergens CPT.
I have created a Custom Template to show the Logo, Name, and description of the restaurants. In the footer, I have added a section where are showed the complete post list of the allergens CPT.
In the middle, I have added a View to show the Menu items related to the restaurant, and it works fine. In the View filter I have set this: Select posts in a Restaurants Menus relationship that are related to the Post where this View is shown.
In this View, I have added a button to edit the Menu item, and also I have added a button to open a popup with a button (generated using a View) to delete the Menu item that I want to delete (but it doesn't delete the post I want to delete, it deletes the last Menu item that I have created).
The code I have used in the Menu item delete button to open the popup is:
<p style="text-align: center;"><a class="delete cancel trash tastofooter popup">cancella</a><span style="display: none;">Delete post [wpv-post-id]:[wpv-post-link]</span></p>
The code I have used in the View to display the delete Menu item button in the popup is:
[cred-delete-post action='trash' onsuccess='45' class='delete cancel trash-popup tastofooter']<i class="fas fa-trash-alt"></i> Cancella prodotto[/cred-delete-post]<span style="display:none;">Delete post [wpv-post-id]:[wpv-post-link]</span>
In screenshot 1 you can see the Menu items list with the Delete and Edit buttons, and I have added the relative post-id
In screenshot 2, that is the popup with the delete button, I have also added the post-id and the post title to see if it deletes the Menu item that I want to delete, but it displays the post-id and title of the last Menu item I have created.
I think that I need to set the Query Filter in View using Post ID or something.
Can you help me to do what I need?
Is there any documentation that you are following?
To do that I have used this guide https://toolset.com/forums/topic/cred-shortcode-to-delete-posts-doesnt-works-fine/#post-2128983
and for the popup, I have used this guide hidden link
Is there a similar example that we can see? I don't know
What is the link to your site? hidden link