Home › Forums › Quform WordPress › Wring Category
- This topic has 3 replies, 2 voices, and was last updated 11 years, 3 months ago by Ally.
- AuthorPosts
- February 7, 2013 at 11:53 pm #2713mtupuschiesParticipant
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?
ThanksFebruary 10, 2013 at 11:48 am #2736AllySupport StaffYou don't have permission to view this content. Please log in or register and then verify your purchases to gain access.
September 30, 2013 at 1:05 pm #6647mtupuschiesParticipantHi 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,
MarcelOctober 1, 2013 at 11:16 am #6672AllySupport 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.