$field->label, 'name' => 'input_' . $field->id, 'type' => $field->type, 'value' => $field->get_value_export( $entry, (string) $field->id, true ), ); } Capture::submission( self::key(), (string) ( $form['id'] ?? '' ), (string) ( $form['title'] ?? '' ), $fields ); } /** * Adds the merge tag to the picker. * * @param array $tags Custom merge tags. * @return array */ public function merge_tags( $tags ) { $tags[] = array( 'label' => __( 'Lead source (Dealroot)', 'dealroot' ), 'tag' => '{dealroot_attribution}', ); return $tags; } /** * Replaces the merge tag. * * @param string $text Text. * @param array $form Form. * @param array $entry Entry. * @param bool $url_encode URL encode. * @param bool $esc_html Escape HTML. * @param bool $nl2br Convert newlines. * @param string $format Format. * @return string */ public function replace_merge_tags( $text, $form, $entry, $url_encode, $esc_html, $nl2br, $format ) { if ( false === strpos( (string) $text, '{dealroot_attribution}' ) ) { return $text; } $summary = Attribution::summary_text(); if ( 'html' === $format ) { $summary = nl2br( esc_html( $summary ) ); } return str_replace( '{dealroot_attribution}', $summary, $text ); } }