Wring Category

Home Forums Quform WordPress Wring Category

This topic is: not resolved
Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #2713
    mtupuschies
    Participant

    Hi I’m using the following code to post submitted forms into a specific existing category.

    function mytheme_create_wp_post($form)
    {
    $title = $form->getValue('iphorm_9_4');
    ob_start();
    include dirname(__FILE__) . '/post_voucher.php';
    $content = ob_get_clean();

    $post = array(
    'post_title' => $title,
    'post_content' => $content,
    'post_status' => 'publish'
    );

    wp_insert_post($post);
    wp_set_object_terms($postId, 'gutscheine', 'category');
    }
    add_action('iphorm_post_process_9', 'mytheme_create_wp_post', 10, 1);

    I got that from your guides and changed it to my settings. The problem is that what ever I try it always posts the forms into the first created category which has the ID 1 (the one wordpress creates and I renamed)

    Can you see the problem?
    Thanks

    #2736
    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.

    #6647
    mtupuschies
    Participant

    Hi Ally,

    sorry for reopening this but I have one question to the post title.
    Right now the code for pulling the post title is:

    $title = $form->getValue('iphorm_3_8');

    What I like for one of my forms that the title is partly constant and partly using the code above.
    How would I need to change the line so it looks like:

    title = WORD + $title = $form->getValue(‘iphorm_3_8’);

    Thanks in advance,
    Marcel

    #6672
    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 4 posts - 1 through 4 (of 4 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