PluginProbe
Double Opt-In for Contact Form 7 – Secure, GDPR-Compliant Email Verification / 5.9.0
Double Opt-In for Contact Form 7 – Secure, GDPR-Compliant Email Verification v5.9.0
5.9.0 5.8.0 5.8.1 5.7.0 5.6.2 5.6.3 5.6.1 5.6.0 5.5.0 5.4.0 5.3.2 5.3.1 5.1.6 5.1.5 trunk 2.1.5 2.11 2.12 2.13 2.15 3.0.0 3.0.1 3.0.2 3.0.3 3.0.5 All 42 releases
← All changes | src/FormSettings/FormSettingsService.php +24 -0 5.4.0 → 5.9.0 View file →
@@ -10,8 +10,9 @@
10 10
11 11 use Forge12\DoubleOptIn\EmailTemplates\EmailTemplateRepository;
12 12 use Forge12\DoubleOptIn\Health\StaleConsentFieldCheck;
13 13 use Forge12\DoubleOptIn\Integration\FormIntegrationRegistry;
14 +use Forge12\DoubleOptIn\Integration\FieldTextProviderInterface;
14 15 use Forge12\DoubleOptIn\Integration\SubmittedContent;
15 16 use Forge12\Shared\LoggerInterface;
16 17
17 18 if ( ! defined( 'ABSPATH' ) ) {
@@ -338,8 +339,31 @@
338 339 $fieldsList[] = array(
339 340 'name' => (string) $name,
340 341 'label' => $label,
341 342 );
343 + }
344 +
345 + // The wording next to each field, where the integration knows it,
346 + // so the consent tab can compare it with the stored consent text.
347 + $texts = $integrationInstance instanceof FieldTextProviderInterface ? $integrationInstance->getFieldTexts( $formId ) : array();
348 + /**
349 + * Visible text per field name (e.g. the label of a consent checkbox).
350 + *
351 + * @since 5.9.0
352 + *
353 + * @param array<string, string> $texts Field name => plain text.
354 + * @param int|string $formId The form ID.
355 + * @param string $integration The integration identifier.
356 + */
357 + $texts = apply_filters( 'f12_doi_form_field_texts', $texts, $formId, $integrationInstance->getIdentifier() );
358 + if ( is_array( $texts ) ) {
359 + foreach ( $fieldsList as &$entry ) {
360 + $text = $texts[ $entry['name'] ] ?? '';
361 + if ( is_string( $text ) && trim( $text ) !== '' ) {
362 + $entry['text'] = trim( $text );
363 + }
364 + }
365 + unset( $entry );
342 366 }
343 367
344 368 // Reconcile the stored consent field with the form's real field
345 369 // names. Settings written before 5.3.2 went through