# acymailing/11.1.0/back/Partial/forms/termspolicy.php

AcyMailing – An Ultimate Newsletter Plugin and Marketing Automation Solution for WordPress, version 11.1.0. 77 lines.

- Page: https://pluginprobe.com/plugins/acymailing/11.1.0/code/back/Partial/forms/termspolicy.php
- Raw: https://pluginprobe.com/plugins/acymailing/11.1.0/raw/back/Partial/forms/termspolicy.php
- Modified: 2026-09-03T09:36:36+00:00

Line numbers below start at 1. Link to a line or a range by appending a fragment to the
page URL, for example `https://pluginprobe.com/plugins/acymailing/11.1.0/code/back/Partial/forms/termspolicy.php#L10-L20`.

```php
<?php
// phpcs:disable WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedVariableFound -- View file, its variables are local to the include scope, not true globals.
defined('ABSPATH') || die('Restricted Access');

use AcyMailing\Helpers\SecurityHelper;

$termspolicy = $form->settings['termspolicy'] ?? [];

if (empty($termspolicy['privacy_type']) || $termspolicy['privacy_type'] === 'article') {
    $privacyURL = acym_getArticleURL((int)($termspolicy['privacy'] ?? 0), false, 'ACYM_PRIVACY_POLICY');
} elseif ($termspolicy['privacy_type'] === 'url') {
    $privacyURL = $termspolicy['privacy_url'] ?? '';
} else {
    $privacyURL = '';
}

if (empty($termspolicy['terms_type']) || $termspolicy['terms_type'] === 'article') {
    $termsURL = acym_getArticleURL((int)($termspolicy['termscond'] ?? 0), false, 'ACYM_TERMS_CONDITIONS');
} elseif ($termspolicy['terms_type'] === 'url') {
    $termsURL = $termspolicy['terms_url'] ?? '';
} else {
    $termsURL = '';
}

if (!empty($termspolicy['privacy_type']) && $termspolicy['privacy_type'] === 'url' && !empty($privacyURL)) {
    $privacyLabel = acym_translation('ACYM_PRIVACY_POLICY');
    $privacyURL = '<a href="'.esc_url($privacyURL).'" target="_blank" rel="noopener noreferrer" aria-label="'.esc_attr(
            $privacyLabel.', '.acym_translation('ACYM_OPENS_NEW_WINDOW')
        ).'">'.esc_html($privacyLabel).'</a>';
}

if (!empty($termspolicy['terms_type']) && $termspolicy['terms_type'] === 'url' && !empty($termsURL)) {
    $termsLabel = acym_translation('ACYM_TERMS_CONDITIONS');
    $termsURL = '<a href="'.esc_url($termsURL).'" target="_blank" rel="noopener noreferrer" aria-label="'.esc_attr(
            $termsLabel.', '.acym_translation('ACYM_OPENS_NEW_WINDOW')
        ).'">'.esc_html($termsLabel).'</a>';
}


if (empty($termsURL) && empty($privacyURL)) {
    $termslink = '';
} elseif (empty($privacyURL)) {
    $termslink = acym_translationSprintf('ACYM_I_AGREE_TERMS', $termsURL);
} elseif (empty($termsURL)) {
    $termslink = acym_translationSprintf('ACYM_I_AGREE_PRIVACY', $privacyURL);
} else {
    $termslink = acym_translationSprintf('ACYM_I_AGREE_BOTH', $termsURL, $privacyURL);
}

if (!empty($termslink)) {
    echo '<div class="acym__subscription__form__termscond">';
    echo '<div class="onefield fieldacyterms" id="field_terms_'.esc_attr($form->form_tag_name).'">';
    echo '<label for="mailingdata_terms_'.esc_attr($form->form_tag_name).'">';
    echo '<input id="mailingdata_terms_'.esc_attr($form->form_tag_name).'" class="checkbox" type="checkbox" name="terms" aria-required="true" title="'.esc_attr(
            acym_translation('ACYM_TERMS_CONDITIONS')
        ).'"/> ';
    echo wp_kses(
        $termslink,
        SecurityHelper::ALLOWED_HTML_TERMS
    );
    echo '</label>';
    echo '</div>';
    ?>

	<style>
		.acym__subscription__form__header .acym__subscription__form__termscond,
		.acym__subscription__form__footer .acym__subscription__form__termscond{
			max-width: 250px;
		}

		<?php echo '#acym_fulldiv_'.esc_html($form->form_tag_name).' '; ?>.acym__subscription__form__fields .acym__subscription__form__termscond input[type="checkbox"]{
			margin-top: 0 !important;
		}
	</style>
	</div>
<?php } ?>

```
