[Gelöst] Redirect to Parent After CRED Child Post Form Submission
This support ticket is created vor 1 Jahr, 3 Monaten. 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.
Heute stehen keine Supporter zur Arbeit im Werkzeugsatz-Forum zur Verfügung. Sie können gern Tickets erstellen, die wir bearbeiten werden, sobald wir online sind. Vielen Dank für Ihr Verständnis.
This is just for the edit form to test. It currently refreshes the page, but does add &_success=783_1_1&_target=826&cred_referrer_form_id=783#cred_form_783_1_1 to the url.
What are the form settings for what to do after the form is submitted?
It must be set to redirect to a specific page or post, otherwise the cred_success_redirect hook will not be triggered. (You can set it to redirect to any page, given that you will overwrite the URL to redirect to.)
Thank You that works now! I hope you are having a great day.
I have another related question. On my CRED form, I'm trying to hide the parent selector since I only want people to be able to submit 1 review. I've tried adding type='hidden', but it's not working so I'm currently just using display: none; , which isn't as secure as I'd like it to be. Here is my field:
<div class="form-group parentSelector">
<label for="%%FORM_ID%%_@company-company-review.parent">[cred_i18n name='@company-company-review.parent-label']Companies Company Reviews[/cred_i18n]</label>
[cred_field field='@company-company-review.parent' value='[wpv-post-id]' type='hidden' class='form-control' output='bootstrap' select_text='--- not set ---' required='true']
</div>
It's not possible to add attributes to the form fields in that way, and clients typically hide the parent selector with CSS.
There isn't really a foolproof way of preventing users from using the browser dev tools to manipulate the selector, as they could do so whichever method is used to hide or disable the selector, and adding server-side validation doesn't really work in this scenario because the only way you would know what is the correct parent ID is based on the value submitted in the form anyway.
Thank You. I'm showing the form only on the parent post when the user doesn't have any child posts for that parent using a view. I'm concerned users would be able to post multiple child posts by going to a different parent and using dev tools to be able to post on the original parent multiple times. Is there a way to limit the amount of child posts for a user for a parent post?