@@ -433,20 +433,20 @@ function osi_wpdc_comment_body( string $comment_body ) {
433433 */
434434add_action ('wpcf7_before_send_mail ' , 'save_form_data_to_cpt ' );
435435function save_form_data_to_cpt ($ contact_form ) {
436- $ submission = WPCF7_Submission::get_instance ();
437- if ($ submission ) {
438- $ data = $ submission ->get_posted_data ();
439-
440- $ post_id = wp_insert_post (array (
441- 'post_title ' => $ data ['your-name ' ],
442- 'post_type ' => 'supporter ' ,
443- 'post_status ' => 'pending '
444- ));
445- update_field ('name ' , $ data ['your-name ' ], $ post_id );
436+ $ submission = WPCF7_Submission::get_instance ();
437+ if ($ submission ) {
438+ $ data = $ submission ->get_posted_data ();
439+
440+ $ post_id = wp_insert_post (array (
441+ 'post_title ' => $ data ['your-name ' ],
442+ 'post_type ' => 'supporter ' ,
443+ 'post_status ' => 'pending '
444+ ));
445+ update_field ('name ' , $ data ['your-name ' ], $ post_id );
446446 update_field ('organization ' , $ data ['your-org ' ], $ post_id );
447447 update_field ('endorsement_type ' , $ data ['your-endorsement ' ], $ post_id );
448448 update_field ('quote ' , $ data ['your-message ' ], $ post_id );
449- } else {
449+ } else {
450450 error_log ('WPCF7_Submission instance is null. ' );
451451 }
452452}
0 commit comments