Tell us what you are trying to do?
I have a form that CREATES a NEW entry of a CPT. The CPT has many fields but the first CRED form is a Create Form that just contains 'Title' and 'Description' fields so user can Create that new Entry.
I'd like On Submit of the form
1) pass value of that NEW CREATION directly to another form/page. So User can then edit that new entry. Also to display the entry 'title' and 'description' on the Edit Form page.
Is there any documentation that you are following?
Trawled Forums, looked at urlparam stuff but can't figure out exactly. THere is so much
Thanks in advance
You already have your CRED form that creates the posts.
Great.
Now, create a CRED form that edits those posts.
In the setting of the form that creates what to perform after the form is submitted, please choose "Display the post".
Then, create a Content template for the posts, and in there, you can add a link to the Edit CRED form you just created.
https://toolset.com/documentation/user-guides/creating-cred-forms/
Or, if you want to call that form (edit post) directly after submit, then proceed like this:
- create a CRED edit form for those posts and place it on any page on your site.
- when you insert the CRED Edit form in this page, pass a specific post ID to be edited:
[cred_form form='edit-a-post' form_name='Edit a post' post='[wpv-search-term param="post_to_edit"]']
- in your CRED form that creates the posts, choose to redirect to a page after submit (does not matter what page)
- use the CRED API to redirect to the proper URL with a parameter in it. Example:
add_filter('cred_success_redirect', 'custom_redirect',10,3);
function custom_redirect($url, $post_id, $form_data)
{
$url = '<em><u>versteckter Link</u></em>' . $post_id;
return $url;
}
https://toolset.com/documentation/programmer-reference/cred-api/#cred_success_redirect
This will now redirect the user to the Edit Post form of the very post the user just submitted with CRED.
HI Beda
Thanks for the reply. The stuff on filters looks like just what I need and the docs are useful. I have yet to try and implement but I can see a way forward. I wanted to reply to ticket, so will just close it here and come back if I get stuck.
Thanks for pointing a clearer way through the jungle.
Ok thanks for this.
I've got Beda's original support guidance working now.
-I'd made a mistake in how the shortcode on the receiving form was written.
Can work with that for now.
Thanks Beda