form( (int) $form_id )->get(); return is_object( $form ) && method_exists( $form, 'get_setting' ) ? (string) $form->get_setting( 'title' ) : ''; } catch ( \Throwable $e ) { return ''; } } /** * {@inheritDoc} */ public function register() { add_action( 'ninja_forms_after_submission', array( $this, 'capture' ) ); } /** * Stores the submission. * * @param array $form_data Submission data. */ public function capture( $form_data ) { $fields = array(); foreach ( (array) ( $form_data['fields'] ?? array() ) as $field ) { $fields[] = array( 'label' => $field['label'] ?? '', 'name' => $field['key'] ?? '', 'type' => $field['type'] ?? '', 'value' => $field['value'] ?? '', ); } Capture::submission( self::key(), (string) ( $form_data['form_id'] ?? '' ), (string) ( $form_data['settings']['title'] ?? '' ), $fields ); } }