Skip Navigation

[Resolved] Option to 'submit and go to next' post to edit, rather than back to main view

This support ticket is created 5 years, 5 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
8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 - -
13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 - -

Supporter timezone: America/New_York (GMT-04:00)

This topic contains 1 reply, has 2 voices.

Last updated by Christian Cox 5 years, 5 months ago.

Assisted by: Christian Cox.

Author
Posts
#1143917

I have a toolset form to edit an existing custom post type. Works fine, but looking to do more.

The client would like a quicker way to get from one post to the next on edit. Is there a way to do instead of a simple submit and return to the main page, a submit and 'next' function to the next post in the list?

#1144477

Hi, we have a PHP API that can help you programmatically redirect to some custom URL, but determining which post is the "next" post is the real challenge. Here's an example that redirects to some arbitrary, hard-coded URL:

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

Replace 12345 with the numeric ID of the Form, and replace hidden link; with the URL you want to redirect to. The problem is determining what that URL should be, programmatically. That would require custom code, and probably falls outside the scope of support we provide here. How is the list determined? Is it a filtered View, or simply all posts ordered by publish date, etc?

Here's the redirection API documentation: https://toolset.com/documentation/programmer-reference/cred-api/#cred_success_redirect

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