form.php 7.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277
  1. <p>
  2. <strong>
  3. <?php esc_html_e( 'Banner text', 'jetpack' ); ?>
  4. </strong>
  5. <ul>
  6. <li>
  7. <label>
  8. <input
  9. <?php checked( $instance['text'], 'default' ); ?>
  10. name="<?php echo esc_attr( $this->get_field_name( 'text' ) ); ?>"
  11. type="radio"
  12. value="default"
  13. />
  14. <?php esc_html_e( 'Default', 'jetpack' ); ?>
  15. </label>
  16. </li>
  17. <li>
  18. <label>
  19. <input
  20. <?php checked( $instance['text'], 'custom' ); ?>
  21. name="<?php echo esc_attr( $this->get_field_name( 'text' ) ); ?>"
  22. type="radio"
  23. value="custom"
  24. />
  25. <?php esc_html_e( 'Custom:', 'jetpack' ); ?>
  26. </label>
  27. </li>
  28. </ul>
  29. <textarea
  30. class="widefat"
  31. name="<?php echo esc_attr( $this->get_field_name( 'customtext' ) ); ?>"
  32. placeholder="<?php echo esc_attr( $instance['default-text'] ); ?>"
  33. ><?php echo esc_html( $instance['customtext'] ); ?></textarea>
  34. </p>
  35. <hr />
  36. <p>
  37. <strong>
  38. <?php esc_html_e( 'Privacy Policy Link', 'jetpack' ); ?>
  39. </strong>
  40. <ul class="eu-cookie-law-widget-policy-url">
  41. <li>
  42. <label>
  43. <input
  44. <?php checked( $instance['policy-url'], 'default' ); ?>
  45. name="<?php echo esc_attr( $this->get_field_name( 'policy-url' ) ); ?>"
  46. type="radio"
  47. value="default"
  48. />
  49. <?php esc_html_e( 'Default', 'jetpack' ); ?>
  50. </label>
  51. </li>
  52. <li>
  53. <label>
  54. <input
  55. <?php checked( $instance['policy-url'], 'custom' ); ?>
  56. name="<?php echo esc_attr( $this->get_field_name( 'policy-url' ) ); ?>"
  57. type="radio"
  58. value="custom"
  59. />
  60. <?php esc_html_e( 'Custom URL:', 'jetpack' ); ?>
  61. </label>
  62. <input
  63. class="widefat"
  64. name="<?php echo esc_attr( $this->get_field_name( 'custom-policy-url' ) ); ?>"
  65. placeholder="<?php echo esc_url( $instance['default-policy-url'] ); ?>"
  66. style="margin-top: .5em;"
  67. type="text"
  68. value="<?php echo esc_url( $instance['custom-policy-url'] ); ?>"
  69. />
  70. <span class="notice notice-warning default-policy" style="display: none;">
  71. <span style="display: block; margin: .5em 0;">
  72. <strong><?php esc_html_e( 'Caution:', 'jetpack' ); ?></strong>
  73. <?php esc_html_e( 'The default policy URL only covers cookies set by Jetpack. If you’re running other plugins, custom cookies, or third-party tracking technologies, you should create and link to your own cookie statement.', 'jetpack' ); ?>
  74. </span>
  75. </span>
  76. <?php if ( Jetpack::is_module_active( 'wordads' ) ) : ?>
  77. <span class="notice notice-warning custom-policy" style="display: none;">
  78. <span style="display: block; margin: .5em 0;">
  79. <strong><?php esc_html_e( 'Caution:', 'jetpack' ); ?></strong>
  80. <?php echo sprintf(
  81. __( 'For GDPR compliance, please make sure your policy contains <a href="%s" target="_blank">privacy information relating to Jetpack Ads</a>.', 'jetpack' ),
  82. esc_url( 'https://jetpack.com/support/ads/#privacy' )
  83. ); ?>
  84. </span>
  85. </span>
  86. <?php endif; ?>
  87. </li>
  88. </ul>
  89. </p>
  90. <p>
  91. <strong>
  92. <?php esc_html_e( 'Link text', 'jetpack' ); ?>
  93. </strong>
  94. <label>
  95. <input
  96. class="widefat"
  97. name="<?php echo $this->get_field_name( 'policy-link-text' ); ?>"
  98. type="text"
  99. value="<?php echo esc_attr( $instance['policy-link-text'] ); ?>"
  100. />
  101. </label>
  102. </p>
  103. <hr />
  104. <p>
  105. <strong>
  106. <?php esc_html_e( 'Button text', 'jetpack' ); ?>
  107. </strong>
  108. <label>
  109. <input
  110. class="widefat"
  111. name="<?php echo $this->get_field_name( 'button' ); ?>"
  112. type="text"
  113. value="<?php echo esc_attr( $instance['button'] ); ?>"
  114. />
  115. </label>
  116. </p>
  117. <hr />
  118. <p>
  119. <strong>
  120. <?php _ex( 'Capture consent & hide the banner', 'action', 'jetpack' ); ?>
  121. </strong>
  122. <ul>
  123. <li>
  124. <label>
  125. <input
  126. <?php checked( $instance['hide'], 'button' ); ?>
  127. name="<?php echo esc_attr( $this->get_field_name( 'hide' ) ); ?>"
  128. type="radio"
  129. value="button"
  130. <?php echo Jetpack::is_module_active( 'wordads' ) ? 'disabled' : ''; ?>
  131. />
  132. <?php esc_html_e( 'after the user clicks the dismiss button', 'jetpack' ); ?>
  133. </label>
  134. </li>
  135. <li>
  136. <label>
  137. <input
  138. <?php checked( $instance['hide'], 'scroll' ); ?>
  139. name="<?php echo esc_attr( $this->get_field_name( 'hide' ) ); ?>"
  140. type="radio"
  141. value="scroll"
  142. <?php echo Jetpack::is_module_active( 'wordads' ) ? 'disabled' : ''; ?>
  143. />
  144. <?php esc_html_e( 'after the user scrolls the page', 'jetpack' ); ?>
  145. </label>
  146. </li>
  147. <li>
  148. <label>
  149. <input
  150. <?php checked( $instance['hide'], 'time' ); ?>
  151. name="<?php echo esc_attr( $this->get_field_name( 'hide' ) ); ?>"
  152. type="radio"
  153. value="time"
  154. <?php echo Jetpack::is_module_active( 'wordads' ) ? 'disabled' : ''; ?>
  155. />
  156. <?php esc_html_e( 'after this amount of time', 'jetpack' ); ?>
  157. </label>
  158. <input
  159. max="1000"
  160. min="3"
  161. name="<?php echo esc_attr( $this->get_field_name( 'hide-timeout' ) ); ?>"
  162. style="padding: 3px 5px; width: 3em;"
  163. type="number"
  164. value="<?php echo esc_attr( $instance['hide-timeout'] ); ?>"
  165. />
  166. <?php esc_html_e( 'seconds', 'jetpack' ); ?>
  167. </li>
  168. </ul>
  169. <?php if ( Jetpack::is_module_active( 'wordads' ) ) : ?>
  170. <span class="notice notice-warning" style="display: block;">
  171. <span style="display: block; margin: .5em 0;">
  172. <?php esc_html_e( 'Visitors must provide consent by clicking the dismiss button when Jetpack Ads is turned on.', 'jetpack' ); ?>
  173. </span>
  174. </span>
  175. <?php endif; ?>
  176. </p>
  177. <hr />
  178. <p>
  179. <strong>
  180. <?php _ex( 'Consent expires after', 'action', 'jetpack' ); ?>
  181. </strong>
  182. <ul>
  183. <li>
  184. <input
  185. max="365"
  186. min="1"
  187. name="<?php echo esc_attr( $this->get_field_name( 'consent-expiration' ) ); ?>"
  188. style="padding: 3px 5px; width: 3.75em;"
  189. type="number"
  190. value="<?php echo esc_attr( $instance['consent-expiration'] ); ?>"
  191. />
  192. <?php esc_html_e( 'days', 'jetpack' ); ?>
  193. </li>
  194. </ul>
  195. </p>
  196. <hr />
  197. <p>
  198. <strong>
  199. <?php _e( 'Color scheme', 'jetpack' ); ?>
  200. </strong>
  201. <ul>
  202. <li>
  203. <label>
  204. <input
  205. <?php checked( $instance['color-scheme'], 'default' ); ?>
  206. name="<?php echo esc_attr( $this->get_field_name( 'color-scheme' ) ); ?>"
  207. type="radio"
  208. value="default"
  209. />
  210. <?php esc_html_e( 'Light', 'jetpack' ); ?>
  211. </label>
  212. </li>
  213. <li>
  214. <label>
  215. <input
  216. <?php checked( $instance['color-scheme'], 'negative' ); ?>
  217. name="<?php echo esc_attr( $this->get_field_name( 'color-scheme' ) ); ?>"
  218. type="radio"
  219. value="negative"
  220. />
  221. <?php esc_html_e( 'Dark', 'jetpack' ); ?>
  222. </label>
  223. </li>
  224. </ul>
  225. </p>
  226. <hr />
  227. <p>
  228. <strong>
  229. <?php _e( 'Position', 'jetpack' ); ?>
  230. </strong>
  231. <ul>
  232. <li>
  233. <label>
  234. <input
  235. <?php checked( $instance['position'], 'bottom' ); ?>
  236. name="<?php echo esc_attr( $this->get_field_name( 'position' ) ); ?>"
  237. type="radio"
  238. value="bottom"
  239. />
  240. <?php esc_html_e( 'Bottom', 'jetpack' ); ?>
  241. </label>
  242. </li>
  243. <li>
  244. <label>
  245. <input
  246. <?php checked( $instance['position'], 'top' ); ?>
  247. name="<?php echo esc_attr( $this->get_field_name( 'position' ) ); ?>"
  248. type="radio"
  249. value="top"
  250. />
  251. <?php esc_html_e( 'Top', 'jetpack' ); ?>
  252. </label>
  253. </li>
  254. </ul>
  255. </p>
  256. <hr />
  257. <p class="small">
  258. <?php esc_html_e( 'It is your own responsibility to ensure that your site complies with the relevant laws.', 'jetpack' ); ?>
  259. <a href="https://jetpack.com/support/extra-sidebar-widgets/eu-cookie-law-widget/">
  260. <?php esc_html_e( 'Click here for more information', 'jetpack' ); ?>
  261. </a>
  262. </p>