Skip Navigation

[Resolved] Allow Redirect to Specific Link or Custom Post Type

This thread is resolved. Here is a description of the problem and solution.

Problem:
Allow Redirect to Specific Link or Custom Post Type using CRED Toolset form

Solution:
CRED offers redirection hook 'cred_success_redirect' which you can use to redirect to your desired page/post according to your requirement.

For example:

add_filter('cred_success_redirect', 'custom_redirect',10,3);
function custom_redirect($url, $post_id, $form_data)
{
    if ($form_data['id']==12) {
        $url =  'http://www.google.com';
         return $url;
   }    
}

You can find proposed solution, in this case, with the following reply:
https://toolset.com/forums/topic/allow-redirect-to-specific-link-or-custom-post-type/#post-628618

Relevant Documentation:

=> https://toolset.com/documentation/programmer-reference/cred-api/#cred_success_redirect

This support ticket is created 6 years, 1 month 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)

Tagged: 

This topic contains 2 replies, has 2 voices.

Last updated by aaronM-9 6 years ago.

Assisted by: Minesh.

Author
Posts
#628564

I would like to have some of my CRED forms redirect to a page that happens to be a custom post type (but isn't the actual post being submitted) but currently I can only select from standard Pages or Posts. It would be nice to be able to either have a complete list of options or even just specify an exact URL to go to.

The reason I created a separate post type called "Private Pages" is so they could be treated differently from a security perspective, but now I can't have CRED forms redirect to them. But having a URL field would add even more versatility because you could have the form redirect anywhere you wanted once the form submits.

#628618

Minesh
Supporter

Languages: English (English )

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

Hello. Thank you for contacting the Toolset support.

Well - CRED offers redirection hook cred_success_redirect which you can use to redirect to your desired page/post according to your requirement.

For example:

add_filter('cred_success_redirect', 'custom_redirect',10,3);
function custom_redirect($url, $post_id, $form_data)
{
    if ($form_data['id']==12) {
        $url =  '<em><u>hidden link</u></em>';
         return $url;
   }    
}

More info:
=> https://toolset.com/documentation/programmer-reference/cred-api/#cred_success_redirect

#630546

Thanks.

This ticket is now closed. If you're a WPML client and need related help, please open a new support ticket.