Below, you’ll find a detailed guide on how to add the WP DSGVO Tools (GDPR) Shortcodes to your WordPress website, including their parameters, examples, and PHP function code. Additionally, we’ll assist you with common issues that might cause the WP DSGVO Tools (GDPR) Plugin shortcodes not to show or not to work correctly.
Before starting, here is an overview of the WP DSGVO Tools (GDPR) Plugin and the shortcodes it provides:
"WP DSGVO Tools (GDPR) is a powerful WordPress plugin that ensures your website's compliance with the EU General Data Protection Regulation (GDPR). It helps safeguard user data and privacy."
- [lw_content_block]
- [cookie_popup_link]
- [imprint]
- [pp_link]
- [privacy_policy]
- [subject_access_request]
- [unsubscribe_form]
WP DSGVO Tools (GDPR) [lw_content_block] Shortcode
The Shapepress-dsgvo plugin shortcode, ‘lw_content_block’, allows users to manage content visibility based on GDPR compliance. It checks if the integration of certain content is allowed by cookie settings. If allowed, it displays the content. If not, it replaces iframes, shows an image, and adds an opt-in handler. This gives users control over their data privacy.
Shortcode: [lw_content_block]
Parameters
Here is a list of all possible lw_content_block shortcode parameters and attributes:
type
– Defines the type of content block to be displayed.shortcode
– Specifies a custom shortcode to be executed within the content block.
Examples and Usage
Basic example – A simple shortcode to display a content block with a specific type.
[lw_content_block type="video" /]
Advanced examples
Here, the shortcode is used to display a content block of a specific type and also execute another shortcode within it. This example is useful when you want to nest shortcodes.
[lw_content_block type="video" shortcode="contact_form" /]
In this next example, the shortcode is used to display a content block of a specific type but without any nested shortcode. This is useful when you want to display a content block but don’t want to execute any other shortcode within it.
[lw_content_block type="video" shortcode="" /]
PHP Function Code
In case you have difficulties debugging what causing issues with [lw_content_block]
shortcode, check below the related PHP functions code.
Shortcode line:
add_shortcode('lw_content_block', 'SPDSGVOContentBlockShortcode');
Shortcode PHP function:
function SPDSGVOContentBlockShortcode($atts, $content){
$params = shortcode_atts( array (
'type' => '',
'shortcode' => ''
), $atts );
if (empty($params['type'])) return $content;
$slug = $params['type'];
global $OL3_LIBS_LOADED;
//$OL3_LIBS_LOADED = 0;
$shortcode = $params['shortcode'];
if (empty($shortcode) == false) $content = do_shortcode("[" . $shortcode ."]");
$embeddingApi = SPDSGVOEmbeddingsManager::getInstance()->getEmbeddingApiBySlug($slug);
if ($embeddingApi == null) return $content;
// if its allowed by cookie nothing is to do here. otherwise replace iframes, show image, add optin handler
if ($embeddingApi->checkIfIntegrationIsAllowed($embeddingApi->slug) == true) return $content;
$originalContentBase64Encoded = base64_encode(htmlentities($content));
$processedContent = $embeddingApi->processContent($content);
$customCssClasses = SPDSGVOSettings::get('embed_placeholder_custom_css_classes');
$content = '<div class="sp-dsgvo sp-dsgvo-embedding-container sp-dsgvo-embedding-' . $embeddingApi->slug . ' '. $customCssClasses .'">' . $processedContent . '<div class="sp-dsgvo-hidden-embedding-content sp-dsgvo-hidden-embedding-content-' . $embeddingApi->slug . '" data-sp-dsgvo-embedding-slug="' . $embeddingApi->slug . '">' . $originalContentBase64Encoded . '</div></div>';
return $content;
}
Code file location:
shapepress-dsgvo/shapepress-dsgvo/public/shortcodes/content-block-shortcode.php
WP DSGVO Tools (GDPR) [cookie_popup_link] Shortcode
The ShapePress-DSGVO shortcode is a tool for creating a customizable cookie popup link. It allows users to customize the link’s class and text. The PHP code associated with this shortcode generates an HTML anchor tag with a class and text defined by the user. By default, the text is set to “Cookie Popup”. The ‘class’ attribute is left blank, allowing users to add their custom CSS classes.
Shortcode: [cookie_popup_link]
Parameters
Here is a list of all possible cookie_popup_link shortcode parameters and attributes:
class
– allows you to add custom CSS classes to the linktext
– sets the display text for the link
Examples and Usage
Basic example – A simple usage of the shortcode to generate a link that triggers the cookie popup.
[cookie_popup_link /]
Advanced examples
Adding a CSS class to the link. This allows you to style the link according to your website’s design. In this example, the class ‘my-custom-class’ is added to the link.
[cookie_popup_link class='my-custom-class' /]
Changing the text of the link. By default, the link text is ‘Cookie Popup’. However, you can change this to any text you want. In this example, the link text is changed to ‘Privacy Settings’.
[cookie_popup_link text='Privacy Settings' /]
Combining both parameters. This example shows how you can use both the ‘class’ and ‘text’ parameters in the shortcode. The link text is set to ‘Privacy Settings’ and the class ‘my-custom-class’ is added to the link.
[cookie_popup_link class='my-custom-class' text='Privacy Settings' /]
PHP Function Code
In case you have difficulties debugging what causing issues with [cookie_popup_link]
shortcode, check below the related PHP functions code.
Shortcode line:
add_shortcode('cookie_popup_link', 'SPDSGVOCookiePopupLinkShortcode');
Shortcode PHP function:
function SPDSGVOCookiePopupLinkShortcode($atts){
$params = shortcode_atts( array (
'class' => '',
'text' => __('Cookie Popup','shapepress-dsgvo'),
), $atts );
return '<a href="#" class="sp-dsgvo-show-privacy-popup '.$params['class'].'">' . $params['text'] . "</a>";
}
Code file location:
shapepress-dsgvo/shapepress-dsgvo/public/shortcodes/cookie-popup-shortcode.php
WP DSGVO Tools (GDPR) [imprint] Shortcode
The Shapepress-dsgvo plugin shortcode ‘imprint’ generates an imprint page on your WordPress site. It pulls data from your settings and formats it into a compliant imprint.
Shortcode: [imprint]
Examples and Usage
Basic example – Displays the imprint information as set in the ShapePress DSGVO plugin settings.
[imprint /]
PHP Function Code
In case you have difficulties debugging what causing issues with [imprint]
shortcode, check below the related PHP functions code.
Shortcode line:
add_shortcode('imprint', 'SPDSGVOImprintShortcode');
Shortcode PHP function:
function SPDSGVOImprintShortcode($atts){
$locale = SPDSGVOLanguageTools::getInstance()->getCurrentLanguageCode();
/*
$params = shortcode_atts(array(
'lang' => $locale
), $atts);
$locale = $params['lang'];
*/
$settings = SPDSGVOSettings::getAll();
$operatorType = $settings['page_operator_type'];
$selectedCountry = $settings['spdsgvo_company_info_countrycode'];
$selectedCountry = SPDSGVOConstants::getCountries()[$selectedCountry];
$selectedCountry = __($selectedCountry, 'shapepress-dsgvo');
$owner = "";
$companyName = "";
switch ($operatorType) {
case 'private':
$companyName = '';
$owner = $settings['page_operator_operator_name'];
$imprint[] = SPDSGVOGetFormatedHtmlTextArray('br', $owner);
break;
case 'one-man':
$companyName = $settings['page_operator_company_name'];
$owner = __('Company owner','shapepress-dsgvo'). ": " . $settings['page_operator_company_law_person'];
$imprint[] = SPDSGVOGetFormatedHtmlTextArray('br', $companyName);
$imprint[] = SPDSGVOGetFormatedHtmlTextArray('br', $owner);
break;
case 'corporation':
$companyName = $settings['page_operator_corporate_name'];
$owner = __('Executive director','shapepress-dsgvo'). ": " .$settings['page_operator_corporate_ceo'] ;
$imprint[] = SPDSGVOGetFormatedHtmlTextArray('br', $companyName);
if (empty($settings['page_operator_corporate_ceo']) == false) $imprint[] = SPDSGVOGetFormatedHtmlTextArray('br', $owner);
break;
case 'society':
$societyName = $settings['page_operator_society_name'];
$board = __('Simplifying board','shapepress-dsgvo'). ": " .$settings['page_operator_society_board'] ;
$imprint[] = SPDSGVOGetFormatedHtmlTextArray('br', $societyName);
if (empty($settings['page_operator_society_board']) == false) $imprint[] = SPDSGVOGetFormatedHtmlTextArray('br', $board);
break;
case 'corp-public-law' :
case 'corp-private-law' :
$companyName = $settings['page_operator_corp_public_law_name'];
$representative = $settings['page_operator_corp_public_law_representative'];
$supervisor = $settings['page_operator_corp_public_law_supervisor'];
if (empty($companyName) == false) $imprint[] = SPDSGVOGetFormatedHtmlTextArray('br', $companyName);
if (empty($representative) == false) {
$imprint[] = SPDSGVOGetFormatedHtmlTextArray('br', __('Representative person','shapepress-dsgvo'). ': '. $representative);
}
if (empty($supervisor) == false) {
$imprint[] = SPDSGVOGetFormatedHtmlTextArray('br', __('Supervisory authority','shapepress-dsgvo'). ': '. $supervisor);
}
break;
}
$selectedCountry = $settings['spdsgvo_company_info_countrycode'];
$selectedCountry = SPDSGVOConstants::getCountries()[$selectedCountry];
$selectedCountry = __($selectedCountry, 'shapepress-dsgvo');
$imprint[] = SPDSGVOGetFormatedHtmlTextArray('br', $settings['spdsgvo_company_info_street']);
$imprint[] = SPDSGVOGetFormatedHtmlTextArray('br', $settings['spdsgvo_company_info_zip'] . " " . $settings['spdsgvo_company_info_loc']);
$imprint[] = SPDSGVOGetFormatedHtmlTextArray('br', $selectedCountry);
$imprint[] = SPDSGVOGetFormatedHtmlTextArray('br', __('Email', 'shapepress-dsgvo'). ': <a href="mailto:' . $settings['spdsgvo_company_info_email'] .'">'.$settings['spdsgvo_company_info_email'].'</a>');
$imprint[] = SPDSGVOGetFormatedHtmlTextArray('br', __('Phone', 'shapepress-dsgvo'). ": " .$settings['spdsgvo_company_info_phone']);
switch ($operatorType) {
case 'private':
break;
case 'one-man':
if (empty($settings['spdsgvo_company_uid_nr']) == false)
{
$imprint[] = SPDSGVOGetFormatedHtmlTextArray('br', __('Sales tax identification number','shapepress-dsgvo'). ": ".$settings['spdsgvo_company_uid_nr']);
}
if (empty($settings['spdsgvo_company_fn_nr']) == false)
{
$imprint[] = SPDSGVOGetFormatedHtmlTextArray('br', __('Commercial book no.','shapepress-dsgvo'). ": ".$settings['spdsgvo_company_fn_nr']);
}
if (empty($settings['spdsgvo_company_law_loc']) == false)
{
$imprint[] = SPDSGVOGetFormatedHtmlTextArray('br', __('§11 Place of Jurisdiction','shapepress-dsgvo'). ": ".$settings['spdsgvo_company_law_loc']);
}
break;
case 'corporation':
$imprint[] = SPDSGVOGetFormatedHtmlTextArray('br', __('Shareholder','shapepress-dsgvo'). ": ".$settings['spdsgvo_company_chairmen']);
$imprint[] = SPDSGVOGetFormatedHtmlTextArray('br', __('Register Court & Register Number','shapepress-dsgvo'). ": ".$settings['spdsgvo_company_law_loc'] . " ". $settings['spdsgvo_company_fn_nr']);
if (empty($settings['spdsgvo_company_uid_nr']) == false)
{
$imprint[] = SPDSGVOGetFormatedHtmlTextArray('br', __('Sales tax identification number','shapepress-dsgvo'). ": ".$settings['spdsgvo_company_uid_nr']);
}
break;
case 'society':
if (empty($settings['page_operator_society_number']) == false)
{
$imprint[] = SPDSGVOGetFormatedHtmlTextArray('br', __('Society number','shapepress-dsgvo'). ": ".$settings['page_operator_society_number']);
}
if (empty($settings['spdsgvo_company_uid_nr']) == false)
{
$imprint[] = SPDSGVOGetFormatedHtmlTextArray('br', __('Sales tax identification number','shapepress-dsgvo'). ": ".$settings['spdsgvo_company_uid_nr']);
}
if (empty($settings['spdsgvo_company_fn_nr']) == false)
{
$imprint[] = SPDSGVOGetFormatedHtmlTextArray('br', __('Commercial book no.','shapepress-dsgvo'). ": ".$settings['spdsgvo_company_fn_nr']);
}
if (empty($settings['spdsgvo_company_law_loc']) == false)
{
$imprint[] = SPDSGVOGetFormatedHtmlTextArray('br', __('§11 Place of Jurisdiction','shapepress-dsgvo'). ": ".$settings['spdsgvo_company_law_loc']);
}
break;
}
$imprint[] = SPDSGVOGetFormatedHtmlTextArray('p', __('Responsible for content','shapepress-dsgvo'). ": ".$settings['spdsgvo_company_resp_content']);
$imprint[] = SPDSGVOGetFormatedHtmlTextArray('p', __('European Commission Online Dispute Resolution (OS) platform for consumers: <a href="https://ec.europa.eu/consumers/odr/" target="_blank">https://ec.europa.eu/consumers/odr/</a>. We are not willing or obliged to participate in a dispute settlement procedure before a consumer arbitration board.','shapepress-dsgvo'));
// $imprint[] = SPDSGVOGetFormatedHtmlTextArray('p', __('','shapepress-dsgvo'). ": ".$settings['']);
//$imprintPage = SPDSGVOSettings::get('imprint_page');
//$imprint = str_replace('[save_date]', date('d.m.Y H:i',strtotime(get_post($imprintPage)->post_modified)), $imprint);
$htmlContent = '';
foreach ($imprint as $lineItem)
{
if (!empty($lineItem['text'])) {
$htmlContent .= SPDSGVOGetHtmlFromPrivacyPolicyLineItem($lineItem);
}
}
return apply_filters('the_content', wp_kses_post($htmlContent));
}
Code file location:
shapepress-dsgvo/shapepress-dsgvo/public/shortcodes/imprint.php
WP DSGVO Tools (GDPR) [pp_link] Shortcode
The Shapepress-dsgvo plugin shortcode, ‘pp_link’, is used to generate a privacy policy link. This shortcode allows you to customize the link’s appearance and text. It uses the privacy policy header from the SPDSGVOSettings as the default text. The ‘class’ parameter can be used to apply CSS styles.
Shortcode: [pp_link]
Parameters
Here is a list of all possible pp_link shortcode parameters and attributes:
class
– Assigns a custom CSS class to the privacy policy linktext
– Changes the displayed text of the privacy policy link
Examples and Usage
Basic example – The shortcode ‘pp_link’ is used to display a link to the privacy policy. It can take two parameters: ‘class’ and ‘text’. By default, ‘text’ is set to the custom header of the privacy policy.
[pp_link /]
Advanced examples
1. In this example, we specify a CSS class for the link. This can be useful for styling the link in a specific way.
[pp_link class="my-custom-class" /]
2. Here, we specify the text for the link. This can be useful if you want to use a different text than the default privacy policy header.
[pp_link text="Read our privacy policy" /]
3. In this advanced example, we specify both the ‘class’ and the ‘text’ parameters. This allows us to both style the link and change its text at the same time.
[pp_link class="my-custom-class" text="Read our privacy policy" /]
PHP Function Code
In case you have difficulties debugging what causing issues with [pp_link]
shortcode, check below the related PHP functions code.
Shortcode line:
add_shortcode('pp_link', 'SPDSGVOPrivacyPolicyLinkShortcode');
Shortcode PHP function:
function SPDSGVOPrivacyPolicyLinkShortcode($atts)
{
$params = shortcode_atts(array(
'class' => '',
'text' => SPDSGVOSettings::get('privacy_policy_custom_header'),
), $atts);
return '<a href="#" class="sp-dsgvo-navigate-privacy-policy ' . $params['class'] . '">' . $params['text'] . "</a>";
}
Code file location:
shapepress-dsgvo/shapepress-dsgvo/public/shortcodes/privacy-policy-link-shortcode.php
WP DSGVO Tools (GDPR) [privacy_policy] Shortcode
The Shapepress DSGVO plugin shortcode generates a detailed privacy policy for a website, adhering to GDPR standards. It customizes the policy based on the site’s specific settings, including the handling of data, usage of forms, security services, and more.
Shortcode: [privacy_policy]
PHP Function Code
In case you have difficulties debugging what causing issues with [privacy_policy]
shortcode, check below the related PHP functions code.
Shortcode line:
add_shortcode('privacy_policy', 'SPDSGVOPrivacyPolicyShortcode');
Shortcode PHP function:
function SPDSGVOPrivacyPolicyShortcode($atts){
$locale = SPDSGVOLanguageTools::getInstance()->getCurrentLanguageCode();
/*
$params = shortcode_atts(array(
'lang' => $locale
), $atts);
$locale = $params['lang'];
*/
$hTagTitle = "h1";
$hTagSubtitle = "h2";
$hTagSubSubtitle = "h3";
$hTagTitle = SPDSGVOSettings::get('privacy_policy_title_html_htag');
$hTagSubtitle = SPDSGVOSettings::get('privacy_policy_subtitle_html_htag');
$hTagSubSubtitle = SPDSGVOSettings::get('privacy_policy_subsubtitle_html_htag');
$privacyPolicy[] = SPDSGVOGetFormatedHtmlTextArray($hTagTitle, SPDSGVOSettings::get('privacy_policy_custom_header'));
//$privacyPolicy[] = SPDSGVOGetFormatedHtmlTextArray($hTagSubtitle, __('Data protection','shapepress-dsgvo'));
$privacyPolicy[] = SPDSGVOGetFormatedHtmlTextArray('p', SPDSGVOLanguageTools::getPrivacyPolicyText('privacy-policy-introduction', $locale));
// <editor-fold desc="Responsible for data processing">
$privacyPolicy[] = SPDSGVOGetFormatedHtmlTextArray($hTagSubtitle, __('Responsible','shapepress-dsgvo'));
$responsibleText = SPDSGVOLanguageTools::getPrivacyPolicyText('content-person', $locale);
// <p>The controller of your personal data on our website is:</p> {:50}, {:51}, {:52} {:53}, {:55}, {:54}.
$operatorType = SPDSGVOSettings::get('page_operator_type');
switch ($operatorType)
{
case 'private':
$responsibleText .= SPDSGVOSettings::get('page_operator_operator_name') .", ";
break;
case 'one-man':
$responsibleText .= SPDSGVOSettings::get('page_operator_company_law_person') .", ";
$responsibleText .= SPDSGVOSettings::get('page_operator_company_name') .", ";
break;
case 'corporation':
$responsibleText .= SPDSGVOSettings::get('page_operator_corporate_name') .", ";
break;
case 'society':
$responsibleText .= SPDSGVOSettings::get('page_operator_society_name') .", ";
break;
case 'corp-public-law':
case 'corp-private-law':
$responsibleText .= SPDSGVOSettings::get('page_operator_corp_public_law_name') .", ";
break;
}
$responsibleText .= SPDSGVOSettings::get('spdsgvo_company_info_street').", ";
$responsibleText .= SPDSGVOSettings::get('spdsgvo_company_info_zip') . " ";
$responsibleText .= SPDSGVOSettings::get('spdsgvo_company_info_loc') .", ";
$countryCodeTemp = SPDSGVOSettings::get('spdsgvo_company_info_countrycode');
if ($countryCodeTemp == "AT") $countryCodeTemp = "Österreich";
if ($countryCodeTemp == "DE") $countryCodeTemp = "Deutschland";
if ($countryCodeTemp == "CH") $countryCodeTemp = "Schweiz";
if ($countryCodeTemp == "IT") $countryCodeTemp = "Italien";
$responsibleText .= $countryCodeTemp .", ";
if (empty(SPDSGVOSettings::get('spdsgvo_company_info_email')) == false)
$responsibleText .= '<a href="mailto:' . SPDSGVOSettings::get('spdsgvo_company_info_email').'">'.SPDSGVOSettings::get("spdsgvo_company_info_email").'</a>' .", ";
if (empty(SPDSGVOSettings::get('spdsgvo_company_info_phone')) == false) $responsibleText .= SPDSGVOSettings::get('spdsgvo_company_info_phone');
$responsibleTextSeparator = apply_filters('spdsgvo_change_responsibleText_separator', ', ');
if (empty($responsibleTextSepartor) !== false) $responsibleText = str_replace( ", ", $responsibleTextSeparator,$responsibleText);
$privacyPolicy[] = SPDSGVOGetFormatedHtmlTextArray('p', $responsibleText);
// </editor-fold>
// 3rd party countries modification
$countryCode = strtolower(SPDSGVOSettings::get('spdsgvo_company_info_countrycode'));
$supportedCountries = array('de','at');
if (in_array($countryCode, $supportedCountries) == false) {
// add special paragraph
if ($countryCode == 'US') {
// only show in us if privacy shield certed
if (SPDSGVOSettings::get('page_operator_privacy_shield') == '1') {
$privacyPolicy[] = SPDSGVOGetFormatedHtmlTextArray('p', SPDSGVOLanguageTools::getPrivacyPolicyText('privacy-policy-introduction-' . $countryCode, $locale));
}
} else {
$privacyPolicy[] = SPDSGVOGetFormatedHtmlTextArray('p', SPDSGVOLanguageTools::getPrivacyPolicyText('privacy-policy-introduction-' . $countryCode, $locale));
}
}
// <editor-fold desc="Data security officer">
$operator_pp_responsibility_type = SPDSGVOSettings::get('operator_pp_responsibility_type');
$dsoText = SPDSGVOLanguageTools::getPrivacyPolicyText('dso-responsible', $locale);
// Unseren Datenschutzbeauftragten erreichen Sie unter:
if ( $operator_pp_responsibility_type == 'external')
{
$dsoText .= SPDSGVOSettings::get('operator_pp_dso_external_company') .", ";
$dsoText .= __('attn.','shapepress-dsgvo') . ' ' . SPDSGVOSettings::get('operator_pp_dso_external_name') .", <br />";
$dsoText .= SPDSGVOSettings::get('operator_pp_dso_external_street') ." <br />";
$dsoText .= SPDSGVOSettings::get('operator_pp_dso_external_zip') ." ";
$dsoText .= SPDSGVOSettings::get('operator_pp_dso_external_loc') ." <br />";
$dsoText .= __('Phone:','shapepress-dsgvo') . ' ' . SPDSGVOSettings::get('operator_pp_dso_external_phone') ." <br />";
$dsoText .= __('Email:','shapepress-dsgvo') . ' <a href= "mailto:' . SPDSGVOSettings::get('operator_pp_dso_external_email').'">'.SPDSGVOSettings::get("operator_pp_dso_external_email").'</a>' ." <br />";
} elseif ($operator_pp_responsibility_type == 'internal')
{
$dsoText .= __('attn.','shapepress-dsgvo') . ' ' . SPDSGVOSettings::get('operator_pp_dso_intern_name') .", <br />";
$dsoText .= SPDSGVOSettings::get('spdsgvo_company_info_street') ." <br />";
$dsoText .= SPDSGVOSettings::get('spdsgvo_company_info_zip') ." ";
$dsoText .= SPDSGVOSettings::get('spdsgvo_company_info_loc') ." <br />";
$dsoText .= __('Phone:','shapepress-dsgvo') . ' ' . SPDSGVOSettings::get('operator_pp_dso_intern_phone') ." <br />";
$dsoText .= __('Email:','shapepress-dsgvo') . ' <a href= "mailto:' . SPDSGVOSettings::get('operator_pp_dso_intern_email').'">'.SPDSGVOSettings::get("operator_pp_dso_intern_email").'</a>' ." <br />";
}
// only add if not none
if ($operator_pp_responsibility_type == 'external' || $operator_pp_responsibility_type == 'internal')
{
$privacyPolicy[] = SPDSGVOGetFormatedHtmlTextArray($hTagSubtitle, __('Data security officer','shapepress-dsgvo'));
$privacyPolicy[] = SPDSGVOGetFormatedHtmlTextArray('p', $dsoText);
}
// </editor-fold>
// <editor-fold desc="Responsible person for data security questions">
if ($operator_pp_responsibility_type == 'no') {
$operator_pp_responsibility_contact = SPDSGVOSettings::get('operator_pp_responsibility_contact');
$dpqText = SPDSGVOLanguageTools::getPrivacyPolicyText('data-protection-responsible', $locale);
// Unseren Ansprechpartner für Datenschutzangelegenheiten erreichen Sie unter:
if ($operator_pp_responsibility_contact == 'external') {
$dpqText .= SPDSGVOSettings::get('operator_pp_dso_contact_external_company') . ", ";
$dpqText .= __('attn.', 'shapepress-dsgvo') . ' ' . SPDSGVOSettings::get('operator_pp_dso_contact_external_name') . ", <br />";
$dpqText .= SPDSGVOSettings::get('operator_pp_dso_contact_external_street') . " <br />";
$dpqText .= SPDSGVOSettings::get('operator_pp_dso_contact_external_loc') . " ";
$dpqText .= SPDSGVOSettings::get('operator_pp_dso_contact_external_zip') . " <br />";
$dpqText .= __('Phone:', 'shapepress-dsgvo') . ' ' . SPDSGVOSettings::get('operator_pp_dso_contact_external_phone') . " <br />";
$dpqText .= __('Email:', 'shapepress-dsgvo') . ' <a href= "mailto:' . SPDSGVOSettings::get('operator_pp_dso_contact_external_email') . '">' . SPDSGVOSettings::get("operator_pp_dso_contact_external_email") . '</a>' . " <br />";
} elseif ($operator_pp_responsibility_contact == 'internal') {
$dpqText .= SPDSGVOSettings::get('spdsgvo_company_info_name') . " <br />";
$dpqText .= __('attn.', 'shapepress-dsgvo') . ' ' . SPDSGVOSettings::get('operator_pp_dso_contact_intern_name') . ", <br />";
$dpqText .= SPDSGVOSettings::get('spdsgvo_company_info_street') . " <br />";
$dpqText .= SPDSGVOSettings::get('spdsgvo_company_info_zip') . " ";
$dpqText .= SPDSGVOSettings::get('spdsgvo_company_info_loc') . " <br />";
$dpqText .= __('Phone:', 'shapepress-dsgvo') . ' ' . SPDSGVOSettings::get('operator_pp_dso_contact_intern_phone') . " <br />";
$dpqText .= __('Email:', 'shapepress-dsgvo') . ' <a href= "mailto:' . SPDSGVOSettings::get('operator_pp_dso_contact_intern_email') . '">' . SPDSGVOSettings::get("operator_pp_dso_contact_intern_email") . '</a>' . " <br />";
}
if ($operator_pp_responsibility_contact == 'external' || $operator_pp_responsibility_contact == 'internal') {
$privacyPolicy[] = SPDSGVOGetFormatedHtmlTextArray($hTagSubtitle, __('Responsible for privacy issues', 'shapepress-dsgvo'));
$privacyPolicy[] = SPDSGVOGetFormatedHtmlTextArray('p', $dpqText);
}
}
// </editor-fold>
// <editor-fold desc="Hosting">
$selectedHostingProvider = SPDSGVOSettings::get('page_basics_hosting_provider');
if (empty($selectedHostingProvider) == false) {
$privacyPolicy[] = SPDSGVOGetFormatedHtmlTextArray($hTagSubtitle, __('Hosting', 'shapepress-dsgvo'));
$privacyPolicy[] = SPDSGVOGetFormatedHtmlTextArray('p', SPDSGVOLanguageTools::getPrivacyPolicyText('hosting-introduction', $locale));
foreach (SPDSGVOConstants::getHostingProvider() as $key => $value) {
if ($key == 'other') continue;
if (in_array($key, $selectedHostingProvider)) {
$privacyPolicy[] = SPDSGVOGetFormatedHtmlTextArray($hTagSubSubtitle, $value);
$privacyPolicy[] = SPDSGVOGetFormatedHtmlTextArray('p', SPDSGVOLanguageTools::getPrivacyPolicyText($key, $locale));
}
}
if (in_array('other', $selectedHostingProvider)) {
//$privacyPolicy[] = SPDSGVOGetFormatedHtmlTextArray($hTagSubSubtitle, __('Hosting Provider', 'shapepress-dsgvo'));
//$privacyPolicy[] = SPDSGVOGetFormatedHtmlTextArray('p', SPDSGVOLanguageTools::getPrivacyPolicyText('other-hosting', $locale));
$privacyPolicy[] = SPDSGVOGetFormatedHtmlTextArray('p', SPDSGVOSettings::get('page_basics_other_provider_text'));
}
}
// </editor-fold>
// <editor-fold desc="Server Logfiles">
$useLogFiles = SPDSGVOSettings::get('page_basics_use_logfiles');
if ($useLogFiles == '1')
{
$logFileText = SPDSGVOLanguageTools::getPrivacyPolicyText('server-log-files', $locale);
$logFileDays = SPDSGVOSettings::get('page_basics_logfiles_life');
$logFileText = str_replace('{COUNT_DAYS}', $logFileDays, $logFileText);
$privacyPolicy[] = SPDSGVOGetFormatedHtmlTextArray($hTagSubtitle, __('Server Log Files','shapepress-dsgvo'));
$privacyPolicy[] = SPDSGVOGetFormatedHtmlTextArray('span', $logFileText);
}
// </editor-fold>
// <editor-fold desc="CDN">
$useCdnProvider = SPDSGVOSettings::get('page_basics_use_cdn');
if ($useCdnProvider == '1')
{
$privacyPolicy[] = SPDSGVOGetFormatedHtmlTextArray($hTagSubtitle, __('CDN Provider','shapepress-dsgvo'));
$privacyPolicy[] = SPDSGVOGetFormatedHtmlTextArray('p', SPDSGVOLanguageTools::getPrivacyPolicyText('cdn-introduction', $locale));
$selectedCdnProvider = SPDSGVOSettings::get('page_basics_cdn_provider');
$selectedCdnProvider = is_array($selectedCdnProvider) ? $selectedCdnProvider : [] ;
foreach (SPDSGVOConstants::getCDNServers() as $key => $value)
{
if ($key == 'other') continue;
if (in_array($key, $selectedCdnProvider))
{
$privacyPolicy[] = SPDSGVOGetFormatedHtmlTextArray($hTagSubSubtitle, $value);
$privacyPolicy[] = SPDSGVOGetFormatedHtmlTextArray('p', SPDSGVOLanguageTools::getPrivacyPolicyText($key, $locale));
}
}
if (in_array('other', $selectedCdnProvider))
{
$privacyPolicy[] = SPDSGVOGetFormatedHtmlTextArray($hTagSubSubtitle, __('CDN Provider','shapepress-dsgvo'));
//$privacyPolicy[] = SPDSGVOGetFormatedHtmlTextArray('p', SPDSGVOLanguageTools::getPrivacyPolicyText('other-cdn', $locale));
$privacyPolicy[] = SPDSGVOGetFormatedHtmlTextArray('p', SPDSGVOSettings::get('page_basics_other_cdn_provider_text'));
}
}
// </editor-fold>
// <editor-fold desc="Formulare">
if (SPDSGVOSettings::get('page_basics_forms_contact') == '1')
{
$privacyPolicy[] = SPDSGVOGetFormatedHtmlTextArray($hTagSubtitle, __('Contact Form','shapepress-dsgvo'));
$privacyPolicy[] = SPDSGVOGetFormatedHtmlTextArray('p', SPDSGVOLanguageTools::getPrivacyPolicyText('contact-form', $locale));
}
if (SPDSGVOSettings::get('page_basics_forms_application') == '1')
{
$privacyPolicy[] = SPDSGVOGetFormatedHtmlTextArray($hTagSubtitle, __('Application Form','shapepress-dsgvo'));
$privacyPolicy[] = SPDSGVOGetFormatedHtmlTextArray('p', SPDSGVOLanguageTools::getPrivacyPolicyText('application-form', $locale));
}
if (SPDSGVOSettings::get('page_basics_forms_contest') == '1')
{
$privacyPolicy[] = SPDSGVOGetFormatedHtmlTextArray($hTagSubtitle, __('Promotional contest or game form','shapepress-dsgvo'));
$privacyPolicy[] = SPDSGVOGetFormatedHtmlTextArray('p', SPDSGVOLanguageTools::getPrivacyPolicyText('contest-form', $locale));
}
if (SPDSGVOSettings::get('page_basics_forms_registration') == '1')
{
$privacyPolicy[] = SPDSGVOGetFormatedHtmlTextArray($hTagSubtitle, __('Registration Form','shapepress-dsgvo'));
$privacyPolicy[] = SPDSGVOGetFormatedHtmlTextArray('p', SPDSGVOLanguageTools::getPrivacyPolicyText('registration-form', $locale));
}
if (SPDSGVOSettings::get('page_basics_forms_comments') == '1')
{
$privacyPolicy[] = SPDSGVOGetFormatedHtmlTextArray($hTagSubtitle, __('Comments Form','shapepress-dsgvo'));
//$privacyPolicy[] = SPDSGVOGetFormatedHtmlTextArray('p', SPDSGVOLanguageTools::getPrivacyPolicyText('comments-form', $locale));
$publishType = SPDSGVOSettings::get('page_basics_forms_comments_publish_type');
if ($publishType = 'name_comment')
{
$privacyPolicy[] = SPDSGVOGetFormatedHtmlTextArray('p', SPDSGVOLanguageTools::getPrivacyPolicyText('comments-form-name', $locale));
} elseif ($publishType = 'nick_comment')
{
$privacyPolicy[] = SPDSGVOGetFormatedHtmlTextArray('p', SPDSGVOLanguageTools::getPrivacyPolicyText('comments-form-nick', $locale));
}
}
// </editor-fold>
// <editor-fold desc="Security Services / Captcha">
$selectedSecurityServices = SPDSGVOSettings::get('page_basics_security_provider');
if (empty($selectedSecurityServices) == false)
{
$privacyPolicy[] = SPDSGVOGetFormatedHtmlTextArray($hTagSubtitle, __('Security Services','shapepress-dsgvo'));
$privacyPolicy[] = SPDSGVOGetFormatedHtmlTextArray('p', SPDSGVOLanguageTools::getPrivacyPolicyText('security-services-introduction', $locale));
foreach (SPDSGVOConstants::getSecurityServices() as $key => $value)
{
if ($key == 'local-security-question') continue;
if ($key == 'other') continue;
if (in_array($key, $selectedSecurityServices))
{
$privacyPolicy[] = SPDSGVOGetFormatedHtmlTextArray($hTagSubSubtitle, $value);
$privacyPolicy[] = SPDSGVOGetFormatedHtmlTextArray('p', SPDSGVOLanguageTools::getPrivacyPolicyText($key, $locale));
}
}
if (in_array('other', $selectedSecurityServices))
{
//$privacyPolicy[] = SPDSGVOGetFormatedHtmlTextArray('p', SPDSGVOLanguageTools::getPrivacyPolicyText('other-security-service', $locale));
$privacyPolicy[] = SPDSGVOGetFormatedHtmlTextArray('p', SPDSGVOSettings::get('page_basics_other_security_provider_text'));
}
}
// </editor-fold>
// todo: Kartendienste
// todo: Chat
// <editor-fold desc="Fonts">
$selectedFontProvider = SPDSGVOSettings::get('page_basics_font_provider');
if (empty($selectedFontProvider) == false)
{
$privacyPolicy[] = SPDSGVOGetFormatedHtmlTextArray($hTagSubtitle, __('Web Fonts','shapepress-dsgvo'));
$privacyPolicy[] = SPDSGVOGetFormatedHtmlTextArray('p', SPDSGVOLanguageTools::getPrivacyPolicyText('webfonts-introduction', $locale));
foreach (SPDSGVOConstants::getFontServices() as $key => $value)
{
if (in_array($key, $selectedFontProvider))
{
$privacyPolicy[] = SPDSGVOGetFormatedHtmlTextArray($hTagSubSubtitle, $value);
$privacyPolicy[] = SPDSGVOGetFormatedHtmlTextArray('p', SPDSGVOLanguageTools::getPrivacyPolicyText($key, $locale));
}
}
}
// </editor-fold>
// <editor-fold desc="Embeddings">
$integrations = SPDSGVOIntegrationApiBase::getAllIntegrationApis(SPDSGVOConstants::CATEGORY_SLUG_EMBEDDINGS, FALSE);
$enabledIntegrationCount = 0;
$integrationTexts = null;
foreach ($integrations as $integrationSlug => $integration)
{
if ($integration->getIsEnabled())
{
$enabledIntegrationCount += 1;
$integrationTexts[] = SPDSGVOGetFormatedHtmlTextArray($hTagSubSubtitle, $integration->getName());
$integrationTexts[] = SPDSGVOGetFormatedHtmlTextArray('p', SPDSGVOLanguageTools::getPrivacyPolicyText($integrationSlug, $locale));
}
}
if ($enabledIntegrationCount > 0)
{
$privacyPolicy[] = SPDSGVOGetFormatedHtmlTextArray($hTagSubtitle, __('Embeddings','shapepress-dsgvo'));
$privacyPolicy[] = SPDSGVOGetFormatedHtmlTextArray('p', SPDSGVOLanguageTools::getPrivacyPolicyText(SPDSGVOConstants::CATEGORY_SLUG_EMBEDDINGS.'-introduction', $locale));
$privacyPolicy = array_merge($privacyPolicy, $integrationTexts);
}
// </editor-fold>
// <editor-fold desc="Shop">
// todo: check wegen bestellung als gast
if ( in_array( 'woocommerce/woocommerce.php', apply_filters( 'active_plugins', get_option( 'active_plugins' ) ) ) ) {
$privacyPolicy[] = SPDSGVOGetFormatedHtmlTextArray($hTagSubtitle, __('Web Shop','shapepress-dsgvo'));
$privacyPolicy[] = SPDSGVOGetFormatedHtmlTextArray('p', SPDSGVOLanguageTools::getPrivacyPolicyText('webshop-introduction', $locale));
}
// </editor-fold>
// <editor-fold desc="Payment Provider">
if (SPDSGVOSettings::get('page_basics_use_payment_provider') == '1')
{
$enabled_gateways = SPDSGVOSettings::get('page_basics_payment_provider');
$enabled_gateways = is_array($enabled_gateways) ? $enabled_gateways : [] ;
$dummyProvider = array('cash', 'cod','bank-transfer');
$privacyPolicy[] = SPDSGVOGetFormatedHtmlTextArray($hTagSubSubtitle, __('Payments are processed via:','shapepress-dsgvo'));
foreach ($enabled_gateways as $gateway)
{
if (in_array($gateway, $dummyProvider)) continue;
$privacyPolicy[] = SPDSGVOGetFormatedHtmlTextArray('p', SPDSGVOLanguageTools::getPrivacyPolicyText($gateway, $locale));
}
}
// </editor-fold>
// <editor-fold desc="Tagmanager">
$integrations = SPDSGVOIntegrationApiBase::getAllIntegrationApis(SPDSGVOConstants::CATEGORY_SLUG_TAGMANAGER, FALSE);
$enabledIntegrationCount = 0;
$integrationTexts = null;
foreach ($integrations as $integrationSlug => $integration)
{
if ($integration->getIsEnabled())
{
$enabledIntegrationCount += 1;
$integrationTexts[] = SPDSGVOGetFormatedHtmlTextArray($hTagSubSubtitle, $integration->getName());
$integrationTexts[] = SPDSGVOGetFormatedHtmlTextArray('p', SPDSGVOLanguageTools::getPrivacyPolicyText($integrationSlug, $locale));
}
}
if ($enabledIntegrationCount > 0)
{
$privacyPolicy[] = SPDSGVOGetFormatedHtmlTextArray($hTagSubtitle, __('Tag Manager','shapepress-dsgvo'));
$privacyPolicy[] = SPDSGVOGetFormatedHtmlTextArray('p', SPDSGVOLanguageTools::getPrivacyPolicyText(SPDSGVOConstants::CATEGORY_SLUG_TAGMANAGER.'-introduction', $locale));
$privacyPolicy = array_merge($privacyPolicy, $integrationTexts);
}
// </editor-fold>
// <editor-fold desc="Analyse">
$integrations = SPDSGVOIntegrationApiBase::getAllIntegrationApis(SPDSGVOConstants::CATEGORY_SLUG_STATISTICS, FALSE);
// add techn. required too (wp stats, matomo, piwik, mautic) because the have another catin the filter
if (SPDSGVOMatomoApi::getInstance()->getIsEnabled()) $integrations[SPDSGVOMatomoApi::getInstance()->getSlug()] =SPDSGVOMatomoApi::getInstance();
if (SPDSGVOWpStatisticsApi::getInstance()->getIsEnabled()) $integrations[SPDSGVOWpStatisticsApi::getInstance()->getSlug()] = SPDSGVOWpStatisticsApi::getInstance();
if (SPDSGVOPiwikApi::getInstance()->getIsEnabled()) $integrations[SPDSGVOPiwikApi::getInstance()->getSlug()] = SPDSGVOPiwikApi::getInstance();
if (SPDSGVOMauticApi::getInstance()->getIsEnabled()) $integrations[SPDSGVOMauticApi::getInstance()->getSlug()] = SPDSGVOMauticApi::getInstance();
$enabledIntegrationCount = 0;
$integrationTexts = null;
foreach ($integrations as $integrationSlug => $integration)
{
if ($integration->getIsEnabled())
{
$integrationSettings = $integration->getSettings();
$ppSlugName = $integrationSlug;
if (array_key_exists('implementationMode',$integrationSettings) && empty($integrationSettings['implementationMode']) == false)
{
$ppSlugName .= '-'.$integrationSettings['implementationMode'];
}
$enabledIntegrationCount += 1;
$integrationTexts[] = SPDSGVOGetFormatedHtmlTextArray($hTagSubSubtitle, $integration->getName());
// do replacings for matomo and piwik
$webAgencyText = "";
if (array_key_exists('agency', $integrationSettings['meta']) == true)
{
$webAgencyText = $integrationSettings['meta']['agency'];
}
$ppText = SPDSGVOLanguageTools::getPrivacyPolicyText($ppSlugName, $locale);
if (strpos($ppSlugName, "by-agency") >= 0)
{
$ppText = str_replace("{web_agency}", $webAgencyText, $ppText);
}
$integrationTexts[] = SPDSGVOGetFormatedHtmlTextArray('p', $ppText);
}
}
if ($enabledIntegrationCount > 0)
{
$privacyPolicy[] = SPDSGVOGetFormatedHtmlTextArray($hTagSubtitle, __('Analysis Services','shapepress-dsgvo'));
$privacyPolicy[] = SPDSGVOGetFormatedHtmlTextArray('p', SPDSGVOLanguageTools::getPrivacyPolicyText(SPDSGVOConstants::CATEGORY_SLUG_STATISTICS.'-introduction', $locale));
$privacyPolicy = array_merge($privacyPolicy, $integrationTexts);
}
// </editor-fold>
// <editor-fold desc="Targeting">
$integrations = SPDSGVOIntegrationApiBase::getAllIntegrationApis(SPDSGVOConstants::CATEGORY_SLUG_TARGETING, FALSE);
$enabledIntegrationCount = 0;
$integrationTexts = null;
foreach ($integrations as $integrationSlug => $integration)
{
if ($integration->getIsEnabled())
{
$enabledIntegrationCount += 1;
$integrationTexts[] = SPDSGVOGetFormatedHtmlTextArray($hTagSubSubtitle, $integration->getName());
$integrationTexts[] = SPDSGVOGetFormatedHtmlTextArray('p', SPDSGVOLanguageTools::getPrivacyPolicyText($integrationSlug, $locale));
}
}
if ($enabledIntegrationCount > 0)
{
$privacyPolicy[] = SPDSGVOGetFormatedHtmlTextArray($hTagSubtitle, __('Ads, Profiling, Tracking, Retargeting','shapepress-dsgvo'));
$privacyPolicy[] = SPDSGVOGetFormatedHtmlTextArray('p', SPDSGVOLanguageTools::getPrivacyPolicyText(SPDSGVOConstants::CATEGORY_SLUG_TARGETING.'-introduction', $locale));
$privacyPolicy = array_merge($privacyPolicy, $integrationTexts);
}
// </editor-fold>
// <editor-fold desc="Newsletter">
if (SPDSGVOSettings::get('page_basics_use_newsletter_provider') == '1')
{
$enabled_newsletter = SPDSGVOSettings::get('page_basics_newsletter_provider');
$enabled_newsletter = is_array($enabled_newsletter) ? $enabled_newsletter : [] ;
$dummyProvider = array('own');
$privacyPolicy[] = SPDSGVOGetFormatedHtmlTextArray($hTagSubtitle, __('Newsletter Services','shapepress-dsgvo'));
foreach (SPDSGVOConstants::getNewsletterIntegrations() as $key => $value)
{
if ($key == 'other') continue;
if (in_array($key, $enabled_newsletter))
{
$privacyPolicy[] = SPDSGVOGetFormatedHtmlTextArray($hTagSubSubtitle, $value);
$privacyPolicy[] = SPDSGVOGetFormatedHtmlTextArray('p', SPDSGVOLanguageTools::getPrivacyPolicyText($key, $locale));
}
}
if (in_array('other', $enabled_newsletter))
{
//$privacyPolicy[] = SPDSGVOGetFormatedHtmlTextArray($hTagSubSubtitle, __('Newsletter Service','shapepress-dsgvo'));
$privacyPolicy[] = SPDSGVOGetFormatedHtmlTextArray('p', SPDSGVOSettings::get('page_basics_other_newsletter_provider_text'));
}
}
// here the affected rights start
// <editor-fold desc="Widerspruchsrecht">
$privacyPolicy[] = SPDSGVOGetFormatedHtmlTextArray($hTagSubtitle, __('Right to object','shapepress-dsgvo'));
$privacyPolicy[] = SPDSGVOGetFormatedHtmlTextArray('p', SPDSGVOLanguageTools::getPrivacyPolicyText('right-to-object', $locale));
// </editor-fold>
// <editor-fold desc="Widerrufsrecht">
$privacyPolicy[] = SPDSGVOGetFormatedHtmlTextArray($hTagSubtitle, __('Withdrawal','shapepress-dsgvo'));
$privacyPolicy[] = SPDSGVOGetFormatedHtmlTextArray('p', SPDSGVOLanguageTools::getPrivacyPolicyText('right-to-withdrawal', $locale));
// </editor-fold>
// <editor-fold desc="Widerrufsrecht">
$privacyPolicy[] = SPDSGVOGetFormatedHtmlTextArray($hTagSubtitle, __('Right to data subject','shapepress-dsgvo'));
$privacyPolicy[] = SPDSGVOGetFormatedHtmlTextArray('p', SPDSGVOLanguageTools::getPrivacyPolicyText('right-to-data-subject', $locale));
// </editor-fold>
/*
$privacyPolicyPage = SPDSGVOSettings::get('privacy_policy_page');
if(get_post($privacyPolicyPage) instanceof WP_POST) {
$privacyPolicy = str_replace('[save_date]', date('d.m.Y H:i',strtotime(get_post($privacyPolicyPage)->post_modified)), $privacyPolicy);
}
*/
$htmlContent = '';
foreach ($privacyPolicy as $lineItem)
{
if (!empty($lineItem['text'])) {
$htmlContent .= SPDSGVOGetHtmlFromPrivacyPolicyLineItem($lineItem);
}
}
return apply_filters('the_content', wp_kses_post($htmlContent));
}
Code file location:
shapepress-dsgvo/shapepress-dsgvo/public/shortcodes/privacy-policy.php
WP DSGVO Tools (GDPR) [subject_access_request] Shortcode
The Shapepress-dsgvo shortcode is designed to create a Subject Access Request form. This form collects user’s first name, last name, and email. If the user is logged in, their data is auto-filled. The form also includes a checkbox for GDPR compliance. Upon submission, a success message is displayed and an email is sent to the user with their stored data.
Shortcode: [subject_access_request]
Examples and Usage
Basic example – Displaying the Subject Access Request form using the shortcode
[subject_access_request /]
PHP Function Code
In case you have difficulties debugging what causing issues with [subject_access_request]
shortcode, check below the related PHP functions code.
Shortcode line:
add_shortcode('subject_access_request', 'SPDSGVODownloadMyDataShortcode');
Shortcode PHP function:
function SPDSGVODownloadMyDataShortcode($atts){
$firstName = '';
$lastName = '';
$email = '';
if(is_user_logged_in()){
$firstName = wp_get_current_user()->user_firstname;
$lastName = wp_get_current_user()->user_lastname;
$email = wp_get_current_user()->user_email;
}
ob_start();
?>
<?php if(isset($_REQUEST['result']) && (sanitize_text_field($_REQUEST['result'])) === 'success'): ?>
<p class="sp-dsgvo sar-success-message"><?php _e('Your request has been created','shapepress-dsgvo')?> <br> <?php _e('You will receive an email from us with a current extract of your data stored with us.','shapepress-dsgvo')?></p>
<?php else: ?>
<div class="sp-dsgvo sp-sar-form">
<form method="post" action="<?php echo esc_url(SPDSGVOSubjectAccessRequestAction::url()); ?>" class="sp-dsgvo-framework">
<?php wp_nonce_field( esc_attr(SPDSGVOSubjectAccessRequestAction::getActionName()). '-nonce' ); ?>
<fieldset>
<div class="lwb-row">
<div class="lwb-col-3">
<label for="email-field"><?php _e('First name','shapepress-dsgvo')?></label>
</div>
<div class="lwb-col-6">
<input class="w-100" required type="text" id="first-name-field" name="first_name" value="<?php echo esc_attr($firstName) ?>" placeholder="<?php _e('First name','shapepress-dsgvo')?>" spellcheck="false" />
</div>
</div>
<div class="lwb-row">
<div class="lwb-col-3">
<label for="email-field"><?php _e('Last name','shapepress-dsgvo')?></label>
</div>
<div class="lwb-col-6">
<input class="w-100" required type="text" id="last-name-field" name="last_name" value="<?php echo esc_attr($lastName) ?>" placeholder="<?php _e('Last name','shapepress-dsgvo')?>" spellcheck="false" />
</div>
</div>
<div class="lwb-row">
<div class="lwb-col-3">
<label for="email-field"><?php _e('Email','shapepress-dsgvo')?></label>
</div>
<div class="lwb-col-6">
<input class="w-100" required type="email" id="email-field" name="email" value="<?php echo esc_attr($email) ?>" placeholder="<?php _e('Email','shapepress-dsgvo')?>" spellcheck="false" />
</div>
</div>
<div class="lwb-row form-row-website-cap">
<div class="lwb-col-3">
<label for="email-field"><?php _e('Website','shapepress-dsgvo')?></label>
</div>
<div class="lwb-col-6">
<input class="w-100" type="text" id="website" name="website" value="" placeholder="" spellcheck="false" />
</div>
</div>
<div class="lwb-row">
<div class="lwb-col-12">
<label for="dsgvo-checkbox">
<input required type="checkbox" id="dsgvo-checkbox" name="dsgvo_checkbox" value="1" />
<span style="font-weight:normal">
<?php
$accepted_text = convDeChars(SPDSGVOSettings::get('sar_dsgvo_accepted_text'));
?>
<?php echo esc_html($accepted_text); ?>
</span>
</label>
</div>
</div>
<br>
<input type="submit" value="<?php _e('Create request','shapepress-dsgvo')?>" />
</fieldset>
</form>
</div>
<?php endif; ?>
<?php
return ob_get_clean();
}
Code file location:
shapepress-dsgvo/shapepress-dsgvo/public/shortcodes/subject-access-request/subject-access-request.php
WP DSGVO Tools (GDPR) [unsubscribe_form] Shortcode
The ShapePress-DSGVO plugin shortcode, ‘unsubscribe_form’, is designed to create a form that allows users to unsubscribe and request data deletion. This form auto-fills the logged-in user’s data and includes fields for the first name, last name, email, and website. It also includes a checkbox for GDPR compliance. Once submitted, the user will receive a confirmation email and their data will be deleted upon approval.
Shortcode: [unsubscribe_form]
Examples and Usage
Basic Example – Displaying the unsubscribe form on a page or post
[unsubscribe_form]
In this example, the shortcode [unsubscribe_form]
is used to display the unsubscribe form on a page or post. This form allows users to unsubscribe and delete their data from your website. The form will be pre-filled with the logged-in user’s information, if available.
PHP Function Code
In case you have difficulties debugging what causing issues with [unsubscribe_form]
shortcode, check below the related PHP functions code.
Shortcode line:
add_shortcode('unsubscribe_form', 'SPDSGVOUnsubscribeShortcode');
Shortcode PHP function:
function SPDSGVOUnsubscribeShortcode($atts){
$firstName = '';
$lastName = '';
$email = '';
if(is_user_logged_in()){
$firstName = wp_get_current_user()->user_firstname;
$lastName = wp_get_current_user()->user_lastname;
$email = wp_get_current_user()->user_email;
}
ob_start();
?>
<?php if(isset($_REQUEST['result']) && (sanitize_text_field($_REQUEST['result'])) === 'success'): ?>
<p class="sp-dsgvo us-success-message"><?php _e('Request sent successfully. You will receive an email in a few minutes.','shapepress-dsgvo')?></p>
<?php elseif(isset($_REQUEST['result']) && sanitize_text_field($_REQUEST['result']) === 'confirmed'): ?>
<p class="sp-dsgvo us-success-message"><?php _e('Request successfully completed. Your data has been completely deleted.','shapepress-dsgvo')?></p>
<?php else: ?>
<div class="sp-dsgvo sp-unsubsribe-form">
<form method="post" action="<?php echo esc_url(SPDSGVOSuperUnsubscribeFormAction::url()) ?>" >
<?php wp_nonce_field( esc_attr(SPDSGVOSuperUnsubscribeFormAction::getActionName()). '-nonce' ); ?>
<fieldset>
<div class="lwb-row">
<div class="lwb-col-3">
<label style="min-width:100px;" for="email-field"><?php _e('First name','shapepress-dsgvo')?></label>
</div>
<div class="lwb-col-6">
<input class="w-100" required type="text" id="first-name-field" name="first_name" value="<?php echo esc_attr($firstName) ?>" placeholder="<?php _e('First name','shapepress-dsgvo')?>" spellcheck="false" />
</div>
</div>
<div class="lwb-row">
<div class="lwb-col-3">
<label for="email-field"><?php _e('Last name','shapepress-dsgvo')?></label>
</div>
<div class="lwb-col-6">
<input class="w-100" required type="text" id="last-name-field" name="last_name" value="<?php echo esc_attr($lastName) ?>" placeholder="<?php _e('Last name','shapepress-dsgvo')?>" spellcheck="false" />
</div>
</div>
<div class="lwb-row">
<div class="lwb-col-3">
<label for="email-field"><?php _e('Email','shapepress-dsgvo')?></label>
</div>
<div class="lwb-col-6">
<input class="w-100" required type="email" id="email-field" name="email" value="<?php echo esc_attr($email) ?>" placeholder="<?php _e('Email','shapepress-dsgvo')?>" spellcheck="false" />
</div>
</div>
<div class="lwb-row form-row-website-cap">
<div class="lwb-col-3">
<label for="email-field"><?php _e('Website','shapepress-dsgvo')?></label>
</div>
<div class="lwb-col-6">
<input class="w-100" type="text" id="website" name="website" value="" placeholder="" spellcheck="false" />
</div>
</div>
<div class="lwb-row">
<div class="lwb-col">
<label for="dsgvo-checkbox">
<input required type="checkbox" id="dsgvo-checkbox" name="dsgvo_checkbox" value="1" />
<?php
$accept_text = convDeChars(SPDSGVOSettings::get('su_dsgvo_accepted_text'));
?>
<span style="font-weight:normal"><?php echo esc_html($accept_text); ?></span>
</label>
</div>
</div>
<br>
<input type="submit" value="<?php _e('Create delete request','shapepress-dsgvo')?>" />
</fieldset>
</form>
</div>
<?php endif; ?>
<?php
return ob_get_clean();
}
Code file location:
shapepress-dsgvo/shapepress-dsgvo/public/shortcodes/super-unsubscribe/unsubscribe-form.php
Conclusion
Now that you’ve learned how to embed the WP DSGVO Tools (GDPR) Plugin shortcodes, understood the parameters, and seen code examples, it’s easy to use and debug any issue that might cause it to ‘not work’. If you still have difficulties with it, don’t hesitate to leave a comment below.
Leave a Reply