I don't think it's possible to do that in the form builder automatically. However, you could have a group of radio buttons with your post formats as options, then use the gform_after_submission hook to go back and update the post format using the WordPress function set_post_format. http://codex.wordpress.org/Function_Reference/set_post_format
You can follow this example:
http://www.gravityhelp.com/documentation/page/Gform_after_submission
But instead of wp_update_post, you could use set_post_format, and set the format to the one the user selected from your radio buttons.
The list of radio buttons would not be generated dynamically. I'm not sure how often the post formats you're using change, but that could be a potential problem, keeping your form and your installation in sync.
If by this: "allow me to show fields based on their selection", you mean "if the user wants to create a post of the Photo format, then show fields to allow them to upload an image, submit a caption submit the location, etc" and "if the user wants to create a post of the Recipe format, then allow them to use the list field to add ingredients one by one, submit the directions, and allow up to 10 photos" ... the answer is yes. Just use conditional logic to allow the fields that pertain only to that post format.
Does that help?
Posted 12 years ago on Sunday August 26, 2012 |
Permalink