Reply To: Pods integration

Home Forums Quform WordPress Pods integration Reply To: Pods integration

#34293
marianogi
Participant

Hi again, here I post what I needed to integrate with Pods plugin. Maybe I can help more people with the same need:

add_filter('quform_post_process_1', function (array $result, Quform_Form $form) {
    $pod_field1 = $form->getValue('quform_1_2');
    $pod_field2 = $form->getValue('quform_1_3');
    $pod_field3 = $form->getValue('quform_1_4');

    $fields = array(
	'post_title'		=> 'item name:' . ' - ' . $pod_field1,
		
        'pod_field1'	=> $pod_field1, 
        'pod_field2'	=> $pod_field2, 
        'pod_field3'	=> $pod_field3
    ); 
                     
    $new_id = pods( 'pod_name_here' )->add( pods_sanitize ($fields) ); 

 
 return $new_id;
}, 10, 2);

Very easy!

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