Skip Navigation

[Résolu] Form returning « Form type and post type do not match »

Ce fil est résolu. Voici une description du problème et la solution proposée.

Problem:

I have a working form to edit a users post, linked from the users account page. I am trying to add a form to renew the post, which is very similar. However, when I try to test it, I get the error: "Form type and post type do not match"

Solution:

I assume we are talking about a Toolset form for editing post, you are going to edit the specific post depends on the URL parameter "post_ids".

If it is, you can get the URL parameter value with shortcode [wpv-search-term], for example:
[wpv-search-term param="post_ids"],

https://toolset.com/documentation/user-guides/views-shortcodes/#wpv-search-term

And pass it to Toolset form shortcode and test again, for example:
[cred_form form='my-form-slug' post='[wpv-search-term param="post_ids"]']

Relevant Documentation:

https://toolset.com/documentation/user-guides/cred-shortcodes/#cred_form

This support ticket is created Il y a 5 années et 7 mois. 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.

No supporters are available to work today on Toolset forum. Feel free to create tickets and we will handle it as soon as we are online. Thank you for your understanding.

Sun Mon Tue Wed Thu Fri Sat
- 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9: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/Hong_Kong (GMT+08:00)

This topic contains 2 réponses, has 2 voix.

Last updated by daveG-7 Il y a 5 années et 7 mois.

Assisted by: Luo Yang.

Auteur
Publications
#1110864

I have a working form to edit a users post, linked from the users account page. I am trying to add a form to renew the post, which is very similar. However, when I try to test it, I get the error: "Form type and post type do not match"

The form is called from within a view loop that calls the user's posts, with the link <a href="[wpv-post-url id=6848]?post_ids=[wpv-post-id]">Renew</a> which gets to the right page, and is how the edit post form is set up.

The post form is set to edit existing content from the same post type as the loop.

Any idea what could be happening?

#1111354

Hello,

I assume we are talking about a Toolset form for editing post, you are going to edit the specific post depends on the URL parameter "post_ids".

If it is, you can get the URL parameter value with shortcode [wpv-search-term], for example:
[wpv-search-term param="post_ids"],

https://toolset.com/documentation/user-guides/views-shortcodes/#wpv-search-term

And pass it to Toolset form shortcode and test again, for example:
[cred_form form='my-form-slug' post='[wpv-search-term param="post_ids"]']

https://toolset.com/documentation/user-guides/cred-shortcodes/#cred_form
post. Optional. The post ID to edit with this form. If form is an edit form and this is skipped, the ID of the current post in the loop will be used.

#1113257

I had forgotten to wrap the form in a view that filters by post ids. Thanks!

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