Skip Navigation

[Resolved] cred-delete-relationship shortcode is not working inside the view

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

Sun Mon Tue Wed Thu Fri Sat
- 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 -
- 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 -

Supporter timezone: Asia/Kolkata (GMT+05:30)

This topic contains 0 replies, has 1 voice.

Last updated by jum 1 month ago.

Assisted by: Minesh.

Author
Posts
#2800754

jum
cred.png

I am trying to:
I have a relationship for post type A and post type B

In a post A single post i have a view (show post B related to post A).

The post are listed fine I can see the list of related post. I need to have a remove button in related posts so the admin can delete the related post from the frontend.

I used this shortcode . I added field widget and added this shortcode but its not showing in frontend.
[cred-delete-relationship
relationship="xxxxxx
related_item_one="' . $parent_id . '"
related_item_two="' . $post_id . '"
type="button"
redirect="self"] Remove [/cred-delete-relationship]

As an alternative, I have the custom code that shows list of related post and have the above shortcode.
in this custom code the remove button for cred-delete-relationship is working fine.

But I want to have this cred-delete-relationship in the view. I have attached the screenshot of the shortcode in view and custom code in frontend

Please guide me how to have this shortcode in the View.

Thanks in advance,

#2801066

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

Hello. Thank you for contacting the Toolset support.

Can you please share problem URL and admin access details and tell me where exactly you added the delete relationship link.

*** Please make a FULL BACKUP of your database and website.***
I would also eventually need to request temporary access (WP-Admin and FTP) to your site. Preferably to a test site where the problem has been replicated if possible in order to be of better help and check if some configurations might need to be changed.

I have set the next reply to private which means only you and I have access to it.

#2801248

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

I've created the following view:
=> hidden link
With the above view I've added the following query filter for post-relationship:

Filter by post relationship or repeatable fields group owner
Select posts in a Uni Groups user groups relationship that are related to the Post where this View is shown.

And within the view's loop editor section I've added the following shortcode that displays the delete relationship link:

 <li> [wpv-post-link] ==== [cred-delete-relationship role_items='$fromViews' relationship='uni-group-user-group' redirect='self' type='button']REMOVE[/cred-delete-relationship]</li>

Them, with your Elementor's template:
=> hidden link

I've added the shortcode block and added the above view as given under:

[wpv-view name="show-all-user-groups-belongs-single-uni-group"]

I can see the Remove button. Can you please confirm it works as expected.

#2801514

jum

Thanks Minesh,

I have checked the view it works now.

I have added the same shortcode in the block editor it works wells.

Thanks for the support.