Reply To: Creating a post and setting category on it

Home Forums Quform WordPress Creating a post and setting category on it Reply To: Creating a post and setting category on it

#30916
akhenaton
Participant

“If you wanted the custom field value added to the post that is created you would need to use the post ID returned from wp_insert_post – hope that makes sense.”
It makes sense, I’ve looked at the wordpress documentation, but I’m no closer to writing my own stuff then I was before. I’ve been trying for a long time to learn programming and I’ve always been let down by the tutorials or books available. And when I say “programming” it is because from what I’ve noticed, all languages seem to share the basics (variables, if clauses, functions, types of data, like strings, integers, etc). I can understand simple examples like “echo Hello world!”, I get the notion of using variables and simple if checks, but once I get to complex, multi-level nested functions I get kind of lost. As you saw, I even managed to create a simple WP plugin, that more or less works, but I’m not sure I’ll be writing a competitor for Quform anytime soon, you know? 😛

OK, sorry about rambling, to get to the point:
Yes, I want the form to save those custom fields attached to the post that is created by the form, not to the page the form is on. Creating custom posts from the frontend is the one area where there has been no progress in WordPress since forever. But then again, if there was, form builders would become more or less redundant.

So if I create a “download” using the Quform form, called, say, “Nvidia Detonator”, it would then create it in the wp_posts table, and also add to the wp_postmeta table the custom fields like “price”, “size in MB”, “download link 1”, and any other custom field I may decide to add to the form.

Also, I haven’t been able to find in the documentation how to include the custom fields in the WordPress theme. Maybe I missed it. True, there are tutorials on the web on how to do that, but usually they only explain how to display simple strings, but not complex data types like selects, checkboxes and the like, which you can create using Quform.

Be inspired. © 2020 ThemeCatcher Ltd. 20-22 Wenlock Road, London, England, N1 7GU | Company No. 08120384 | Built with React | Privacy Policy