PluginProbe
The GDPR Framework By Data443 / trunk
The GDPR Framework By Data443 vtrunk
2.5.0 2.4.0 trunk 1.0.0 1.0.1 1.0.10 1.0.11 1.0.12 1.0.13 1.0.14 1.0.3 1.0.33 1.0.34 1.0.35 1.0.36 1.0.37 1.0.39 1.0.4 1.0.40 1.0.41 1.0.42 1.0.43 1.0.44 1.0.45 1.0.46 All 41 releases
gdpr-framework / src / Components / DoNotSell / AdminTabDoNotSell.php

AdminTabDoNotSell.php in The GDPR Framework By Data443 trunk, at src/Components/DoNotSell/AdminTabDoNotSell.php

77 lines 2.0 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 namespace Codelight\GDPR\Components\DoNotSell;
4
5 if ( ! defined( 'ABSPATH' ) ) exit;
6
7 use Codelight\GDPR\Admin\AdminTab;
8
9 class AdminTabDoNotSell extends AdminTab {
10
11 /* @var string */
12 protected $slug = 'do-not-sell';
13
14 /* @var PolicyGenerator */
15 protected $policyGenerator;
16
17 public function __construct()
18 {
19 $this->title = _x( 'Do Not Sell My Data', '(Admin)', 'gdpr-framework' );
20
21 add_action( 'ccpa/admin/action/PrivacyManager/generate', array( $this, 'generateDoNotSell' ) );
22 }
23
24 public function init() {
25 /**
26 * Do Not Sell My Data settings
27 */
28 $this->registerSettingSection(
29 'ccpa_about_privacy_safe_section',
30 _x( 'Do Not Sell My Data', '(Admin)', 'gdpr-framework' ),
31 array( $this, 'renderAboutHeader' )
32 );
33
34 $this->registerSettingField(
35 'ccpa_privacy_safe_shortcode',
36 _x( 'Shortcode', '(Admin)', 'gdpr-framework' ),
37 array( $this, 'shortcode' ),
38 'ccpa_about_privacy_safe_section'
39 );
40 $this->registerSettingField(
41 'ccpa_privacy_safe_shortcodephp',
42 _x( 'Shortcode for PHP', '(Admin)', 'gdpr-framework' ),
43 array( $this, 'shortcodephp' ),
44 'ccpa_about_privacy_safe_section'
45 );
46 $this->registerSettingField(
47 'ccpa_privacy_safe_posts',
48 _x( 'View Requests', '(Admin)', 'gdpr-framework' ),
49 array( $this, 'postlink' ),
50 'ccpa_about_privacy_safe_section'
51 );
52
53 }
54
55
56
57 public function renderAboutHeader() {
58 echo '<p>Place this shortcode on the page you would like to accept requests from users to not sell their information. We recommend placing the shortcode under the privacy tools shortcode on the privacy tools page.</p>';
59 }
60
61 public function renderSubmitButton()
62 {
63 // FRAM-137 - remove unnecessary save button
64 // this overrides the placement of a save button which is not needed
65 }
66
67 public function shortcode() {
68 echo "<code>[gdpr_do_not_sell_form]</code>";
69 }
70 public function shortcodephp() {
71 echo "<code>echo do_shortcode('[gdpr_do_not_sell_form]');</code>";
72 }
73 public function postlink() {
74 echo "<a href='/wp-admin/edit.php?post_type=donotsellrequests'>View Requests</a>";
75 }
76 }
77