$field ) { $type = (string) ( $field['type'] ?? '' ); if ( in_array( $type, self::SKIP, true ) || 0 === strpos( $type, 'payment' ) ) { continue; } $label = (string) ( $field['name'] ?? ( $form_data['form_fields'][ $id ]['label'] ?? $id ) ); $value = $field['value'] ?? ''; // Checkboxes and radio buttons carry their label and the chosen options in the value. if ( is_array( $value ) && ( isset( $value['label'] ) || isset( $value['name'] ) ) ) { $label = (string) ( $value['name'] ?? $label ); $value = $value['label'] ?? ( $field['value_raw'] ?? '' ); } $fields[] = array( 'label' => wp_strip_all_tags( $label ), 'name' => (string) ( $field['meta_key'] ?? 'field_' . $id ), 'type' => $type, 'value' => $value, ); } Capture::submission( self::key(), (string) ( $form_data['id'] ?? ( $entry['id'] ?? '' ) ), (string) ( $form_data['settings']['form_title'] ?? '' ), $fields ); } }