PluginProbe
AcyMailing – An Ultimate Newsletter Plugin and Marketing Automation Solution for WordPress / 11.0.3
AcyMailing – An Ultimate Newsletter Plugin and Marketing Automation Solution for WordPress v11.0.3
11.1.1 11.1.0 11.0.5 11.0.4 11.0.3 11.0.2 11.0.1 11.0.0 10.11.1 10.11.0 10.10.2 10.10.1 10.10.0 10.9.1 trunk 10.0.0 10.0.1 10.1.0 10.1.1 10.1.2 10.1.3 10.1.4 10.2.0 10.2.1 10.2.2 All 62 releases
acymailing / back / Partial / forms / tracking_consent.php

tracking_consent.php in AcyMailing – An Ultimate Newsletter Plugin and Marketing Automation Solution for WordPress 11.0.3, at back/Partial/forms/tracking_consent.php

28 lines 1.1 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 // phpcs:disable WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedVariableFound -- View file, its variables are local to the include scope, not true globals.
3 defined('ABSPATH') || die('Restricted Access');
4
5 use AcyMailing\Classes\UserClass;
6
7 if (($form->settings['termspolicy']['tracking_consent'] ?? 'no') !== 'yes') {
8 return;
9 }
10
11 $trackingChecked = false;
12 $currentEmail = acym_currentUserEmail();
13 if (!empty($currentEmail)) {
14 $existingUser = (new UserClass())->getOneByEmail($currentEmail);
15 if (!empty($existingUser->id)) {
16 $trackingChecked = (int)$existingUser->tracking === 1;
17 }
18 }
19
20 echo '<div class="onefield fieldacytracking" id="field_tracking_'.esc_attr($form->form_tag_name).'">';
21 echo '<label for="mailingdata_tracking_'.esc_attr($form->form_tag_name).'">';
22 echo '<input type="hidden" name="user[tracking]" value="0"/>';
23 echo '<input id="mailingdata_tracking_'.esc_attr($form->form_tag_name).'" class="checkbox" type="checkbox" name="user[tracking]" value="1" '.acym_checked($trackingChecked, true, false).'/> '.esc_html(
24 acym_translation('ACYM_TRACKING_CONSENT')
25 );
26 echo '</label>';
27 echo '</div>';
28