Skip Navigation

[Resolved] A post that searches using a RPG cannot be deleted without deleting the RFG data

This support ticket is created 4 years, 8 months ago. There's a good chance that you are reading advice that it now obsolete.

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 2 replies, has 2 voices.

Last updated by ceciliaW9184 4 years, 8 months ago.

Assisted by: Minesh.

Author
Posts
#1637735

hidden link

I have clinical trials that use locations in a repeatable field group called Additional Locations to populate a search result page. When I delete a trial or put a trial in draft status, the trial is still seen on the search results page. then clicking on that trial creates a 404 error. I have to manually delete the additional location for the trial to be removed.

This is not a big deal when you have 1 location. But the purpose of an RFG is to handle many fields. I may have 150 locations for one trial. I don't want to have to delete all 150 locations for a trial to disappear.

I heard this bug is being worked on. Any estimate on when this will happen?

#1638293

Minesh
Supporter

Languages: English (English )

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

Hello. Thank you for contacting the Toolset support.

This is known issue to us but still we do not have any ETA on it.

As I shared before - you can use that code but that code which I shared will run when you trash the post.
=> https://toolset.com/forums/topic/split-displaying-repeatable-group-live-site-another-issues/#post-1602653

Maybe you can try to use the hook "transition_post_status" and target the post status when you would like to run the code.
=> https://developer.wordpress.org/reference/hooks/transition_post_status/

Please backup your databases before you try to run such custom code or first try to check with your staging site.

#1658525

Your first snippet of code worked on trash Posts. Thank you!

Can you add a hook that will do the same to Expired or Draft posts?