$field ) { $normalized[] = array( 'label' => $field['name'] ?? '', 'name' => 'field_' . ( $field['id'] ?? $id ), 'type' => $field['type'] ?? '', 'value' => $field['value'] ?? '', ); } Capture::submission( self::key(), (string) ( $form_data['id'] ?? '' ), (string) ( $form_data['settings']['form_title'] ?? '' ), $normalized ); } /** * Registers the smart tag in the WPForms UI. * * @param array $tags Smart tags. * @return array */ public function smart_tags( $tags ) { $tags['dealroot_attribution'] = __( 'Lead source (Dealroot)', 'dealroot' ); return $tags; } /** * Replaces the smart tag. * * @param string $content Content. * @param string $tag Tag name. * @return string */ public function process_smart_tag( $content, $tag ) { if ( 'dealroot_attribution' !== $tag ) { return $content; } return str_replace( '{dealroot_attribution}', esc_html( Attribution::summary_text() ), $content ); } }