Creating Posts from Forms

Home Forums Quform WordPress Creating Posts from Forms

This topic is: resolved
Viewing 11 posts - 1 through 11 (of 11 total)
  • Author
    Posts
  • #29407
    therondp
    Participant

    Hi there can QuForm create posts from the data submitted in the form like Gravity Forms does?

    #29433
    Ally
    Support Staff

    You don't have permission to view this content. Please log in or register and then verify your purchases to gain access.

    #29442
    therondp
    Participant

    Thanks 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);

    #29454
    Ally
    Support Staff

    You don't have permission to view this content. Please log in or register and then verify your purchases to gain access.

    #29460
    therondp
    Participant

    Thanks 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 area

    I hope that all makes sense and I really appreciate your support on this!

    Best wishes
    Paul

    #29470
    Ally
    Support Staff

    You 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.
    #29480
    therondp
    Participant

    That’s great thanks so much it worked perfectly!

    #29537
    therondp
    Participant

    Again 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?

    #29542
    therondp
    Participant

    No worries I have managed to fix this myself.

    #29609
    therondp
    Participant

    I 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…

    #29630
    Ally
    Support Staff

    You don't have permission to view this content. Please log in or register and then verify your purchases to gain access.

Viewing 11 posts - 1 through 11 (of 11 total)
  • You must be logged in to reply to this topic.
Be inspired. © 2024 ThemeCatcher Ltd. 20-22 Wenlock Road, London, England, N1 7GU | Company No. 08120384 | Built with React | Privacy Policy