← All changes
|
modules/wordads/php/class-wordads-ccpa-do-not-sell-link-widget.php
+43
-0
16.2-beta
→
16.3
View file →
| @@ -1,0 +1,43 @@ | ||
| 1 | +<?php | |
| 2 | +/** | |
| 3 | + * CCPA Do Not Sell Widget | |
| 4 | + * | |
| 5 | + * @package automattic/jetpack | |
| 6 | + */ | |
| 7 | + | |
| 8 | +if ( ! defined( 'ABSPATH' ) ) { | |
| 9 | + exit( 0 ); | |
| 10 | +} | |
| 11 | + | |
| 12 | +/** | |
| 13 | + * Class WordAds_Ccpa_Do_Not_Sell_Link_Widget | |
| 14 | + */ | |
| 15 | +class WordAds_Ccpa_Do_Not_Sell_Link_Widget extends WP_Widget { | |
| 16 | + | |
| 17 | + /** | |
| 18 | + * WordAds_Ccpa_Do_Not_Sell_Link_Widget constructor. | |
| 19 | + */ | |
| 20 | + public function __construct() { | |
| 21 | + parent::__construct( | |
| 22 | + 'wordads_ccpa_do_not_sell_link_widget', | |
| 23 | + /** This filter is documented in modules/widgets/facebook-likebox.php */ | |
| 24 | + apply_filters( 'jetpack_widget_name', __( 'Do Not Sell Link (US Privacy)', 'jetpack' ) ), | |
| 25 | + array( | |
| 26 | + 'description' => __( 'Inserts "Do Not Sell or Share My Personal Information" link required by some US states to opt-out of targeted advertising', 'jetpack' ), | |
| 27 | + 'customize_selective_refresh' => true, | |
| 28 | + ) | |
| 29 | + ); | |
| 30 | + } | |
| 31 | + | |
| 32 | + /** | |
| 33 | + * Widget outputter. | |
| 34 | + * | |
| 35 | + * @param array $args Widget args. | |
| 36 | + * @param array $instance Widget instance. | |
| 37 | + */ | |
| 38 | + public function widget( $args, $instance ) { // phpcs:ignore VariableAnalysis.CodeAnalysis.VariableAnalysis.UnusedVariable | |
| 39 | + echo $args['before_widget']; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped | |
| 40 | + echo do_shortcode( '[privacy-do-not-sell-link]' ); | |
| 41 | + echo $args['after_widget']; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped | |
| 42 | + } | |
| 43 | +} | |