Skip Navigation

[Resolved] Cred Form Redirection to an Edit form

This support ticket is created 5 years, 11 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
- 7:00 – 14:00 7:00 – 14:00 7:00 – 14:00 7:00 – 14:00 7:00 – 14:00 -
- 15:00 – 16:00 15:00 – 16:00 15:00 – 16:00 15:00 – 16:00 15:00 – 16:00 -

Supporter timezone: Europe/London (GMT+00:00)

This topic contains 2 replies, has 2 voices.

Last updated by Nashaat 5 years, 11 months ago.

Assisted by: Nigel.

Author
Posts
#1176831

I have emebed a cred form in a single post that should create secondary languages (not finished yet).. what i am trying to do is , when user submit the embed form will be redirected to an edit form. like foloowing:

1- user click on the embed form button "create English"
2- user get to the redirected to an edit form specified in a cred redirection hook.

i tried following but its not working

/** Redirect Add Russian - Button Form **/
add_filter('cred_success_redirect', 'custom_redirect',10,3);
function custom_redirect($url, $post_id, $form_data)
{
  
  global $post;
  $post_slug=$post->post_name;
  $layout_slug='?layout_id=46';
  
  //create an array of values with all ID's of the Forms you want to check:
  $ids = array("49","51");
  //Check if the current form ID is one of in the above array:
  if (in_array($form_data['id'], $ids) ){
        return '<em><u>hidden link</u></em>;?php echo $post_slug; ?>';
    return $url;
  }
}
#1176883

Nigel
Supporter

Languages: English (English ) Spanish (Español )

Timezone: Europe/London (GMT+00:00)

Hi there

Without getting into the details of what you are aiming to achieve, you have incorrectly formed PHP code, guessing your intent the final part should look something like this:

if (in_array($form_data['id'], $ids) ){
	$url = '<em><u>hidden link</u></em>' . $post_slug . '/' . $layout_slug;
}
return $url;

If that is not what you need I'll take a closer look.

#1176891

Yes! This did the trick as needed. Thank you very much.