Home › Forums › Quform WordPress › Creating Posts from Forms
- This topic has 10 replies, 2 voices, and was last updated 4 years, 8 months ago by Ally.
- AuthorPosts
- June 3, 2019 at 10:25 am #29407therondpParticipant
Hi there can QuForm create posts from the data submitted in the form like Gravity Forms does?
June 5, 2019 at 2:22 pm #29433AllySupport StaffYou don't have permission to view this content. Please log in or register and then verify your purchases to gain access.
June 10, 2019 at 3:22 am #29442therondpParticipantThanks for sharing I followed the guide step by step and got a failed plugin upload message – This code (below message) I used in a folder called quform-custom-code which I zipped and then uploaded to my WordPress plugin upload. The post type coupons I entered in the code is one of my custom post types.
I am wondering if one of your developers could whip up the basic plugin for this with the option to add Post Title, Post Content, Featured Image, categories and custom fields? That would really help me and I’m sure it’s second nature to your developers to do quickly.
/*
* Plugin Name: Quform Custom Code
* Description: Custom code for Quform.
* Version: 1.0
*/// Paste in your custom code below
add_filter(‘quform_post_process_7’, function (array $result, Quform_Form $form) {
$title = $form->getValue(‘quform_7_1’);
$content = $form->getValue(‘quform_7_15’);$post = array(
‘post_title’ => $title,
‘post_content’ => $content,
‘post_type’ => ‘Coupons’,
‘post_status’ => ‘draft’
);wp_insert_post($post);
return $result;
}, 10, 2);June 10, 2019 at 4:21 pm #29454AllySupport StaffYou don't have permission to view this content. Please log in or register and then verify your purchases to gain access.
June 11, 2019 at 10:04 am #29460therondpParticipantThanks for that here is the page the form is on https://imdiscountcodes.com/test-page/
And here are the fields needed for posting to the custom post called Coupons
The first two fields of name and email address are not needed for posting and also no categories are needed.
Field 1: Name of app on promotion = title of post
Field 2: Website (custom field) = wp_coupons_discount_url
Field 3: Coupon code (custom field) = wp_coupons_discount_code
Field 4: Discount amount (custom field) = wp_coupons_discount_percent
Field 5: Company logo = featured image of post
Field 6: Promotion Expiry Date (custom field) = wp_coupons_expiration
Field 7: Describe the promotion = standard post content areaI hope that all makes sense and I really appreciate your support on this!
Best wishes
PaulJune 14, 2019 at 2:26 pm #29470AllySupport StaffYou don't have permission to view this content. Please log in or register and then verify your purchases to gain access.
Attachments:
You must be logged in to view attached files.June 14, 2019 at 10:36 pm #29480therondpParticipantThat’s great thanks so much it worked perfectly!
June 27, 2019 at 12:56 am #29537therondpParticipantAgain I want to say thanks for the work on this.
I have another question though have a look at this screenshot https://cl.ly/286f86700571
Notice how when you input text it becomes all garbled because the user inputted text is over the field labels? Makes it unreadable.
The form is embedded using the QuForm widget in Elementor to create this Elementor pop-up. Not sure if that is the reason why there is an issue because its part of a pop-up seems strange if so. I know Elementor wont help with this as they will say its an issue with QuForm and not Elementor.
The same quform works perfectly well for example here https://imdiscountcodes.com/coupons-promo-codes/longtail-pro-discount/ at the top of the page?
June 27, 2019 at 12:52 pm #29542therondpParticipantNo worries I have managed to fix this myself.
July 10, 2019 at 8:07 am #29609therondpParticipantI would like to know if QuForm have any plans to create a dedicated module for creating posts from submitted form data like Gravity Forms does?
I ask because I’m now in a situation where I need another forms content to be posted and wondering if that can be done in the same plugin you created for me or does a new plugin have to be created for posting a new custom post type?
I appreciate your support…
July 12, 2019 at 10:46 am #29630AllySupport StaffYou don't have permission to view this content. Please log in or register and then verify your purchases to gain access.
- AuthorPosts
- You must be logged in to reply to this topic.