This support ticket is created Il y a 8 années et 1 mois. 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.
No supporters are available to work today on Toolset forum. Feel free to create tickets and we will handle it as soon as we are online. Thank you for your understanding.
I am trying to:
Return to anchor of grid list on a view after save new record using cred form for that list. I saw this issue and has similar issue but they are returning to a list view https://toolset.com/forums/topic/anchor-argument-in-view/
Looking at this as a possible starting point based on above link , not sure how the anchor tag <a name="competitors"> is passed to Cred. and what to set the Cred form options " Choose what to do after visitors submit this form" Cred form we are testing the id is 698
add_filter('cred_success_redirect', 'custom_redirect_anchor_after_cred_save',10,3);
function custom_redirect_anchor_after_cred_save($url, $post_id, $form_data) {
if ($form_data['id']==698)
{
$url .= '#' . $post_id;
}
return $url;
}
Screen shot show Layout with Grid, button add competitor calls CRED and when save cred i want to go back to the Competitor grid section of the Layout refreshed so we can see the new record.
Hello. Thank you for contacting the Toolset support.
I would like to know have you already added the anchor in the view? If no, you should add anchors to your view, please see following tutorial:
=> hidden link
As well as, you need to set $url variable to your desired redirect URL.
I hope this will help you to fix your issue and please feel free to get in touch with me if you need further assistance.
Yes , I have added anchors to each section of the view. I was testing this function and it works getting us back to main view after cred save but not all the way to the anchor. and its working for multiple forms. What / where would I need to add to get to the anchor? $url .= '#' . $post_id;
Also key point that I did not seem to find when doing this is on CRED form
set "Choose what to do after visitors submit this form:"
= go to a page and choose page name , the same as this form
/* Link Company to Program Redirect ********** /
add_filter('cred_success_redirect', 'competitor_program_redirect',10,3);
function competitor_program_redirect($url, $post_id, $form_data)
{