is_not_paying() ) { if ( $field['blockName'] == 'jet-forms/text-field' ) { $fields[$field['attrs']['name']] = $field['attrs']['label']; } } } } $fields['form_id'] = __( 'Form ID', 'advanced-form-integration' ); $special_tags = adfoin_get_special_tags(); if ( is_array( $fields ) && is_array( $special_tags ) ) { $fields = $fields + $special_tags; } return $fields; } add_action( 'jet-form-builder/form-handler/after-send', 'adfoin_jet_form_builder_submit', 10, 2 ); function adfoin_jet_form_builder_submit( $data, $is_success ) { global $wpdb, $post; $form_id = ( isset( $data->form_id ) ? $data->form_id : false ); if ( !$form_id ) { return; } $integration = new Advanced_Form_Integration_Integration(); $saved_records = $integration->get_by_trigger( 'jetformbuilder', $form_id ); if ( empty( $saved_records ) ) { return; } $record_id = jet_fb_action_handler()->get_context( JFB_Modules\Form_Record\Action_Types\Save_Record::ID, 'id' ); if ( empty( $record_id ) ) { return; } $fields = $wpdb->get_results( $wpdb->prepare( "SELECT * FROM {$wpdb->prefix}jet_fb_records_fields WHERE record_id = %d", $record_id ), ARRAY_A ); $posted_data = array(); if ( !empty( $fields ) ) { foreach ( $fields as $field ) { if ( adfoin_fs()->is_not_paying() ) { if ( $field['field_type'] == 'text-field' ) { $posted_data[$field['field_name']] = $field['field_value']; } } } } $special_tag_values = adfoin_get_special_tags_values( $post ); if ( is_array( $special_tag_values ) ) { $posted_data = array_merge( $posted_data, $special_tag_values ); } $posted_data['form_id'] = $form_id; adfoin_dispatch_integrations( $saved_records, $posted_data ); } if ( adfoin_fs()->is_not_paying() ) { add_action( 'adfoin_trigger_extra_fields', 'adfoin_jetformbuilder_trigger_fields' ); } function adfoin_jetformbuilder_trigger_fields() { ?>