file-text"> 3258 a4345e5759 first commit 5 vuotta sitten 3350 a4345e5759 first commit 5 vuotta sitten 3351 a4345e5759 first commit 5 vuotta sitten 3379 a4345e5759 first commit 5 vuotta sitten 3380 a4345e5759 first commit 5 vuotta sitten 3381 a4345e5759 first commit 5 vuotta sitten 3394 a4345e5759 first commit 5 vuotta sitten 3394_fsm a4345e5759 first commit 5 vuotta sitten 3394_vm a4345e5759 first commit 5 vuotta sitten 3395 a4345e5759 first commit 5 vuotta sitten 3429 a4345e5759 first commit 5 vuotta sitten 3430 a4345e5759 first commit 5 vuotta sitten 3431 a4345e5759 first commit 5 vuotta sitten 3433 a4345e5759 first commit 5 vuotta sitten 3439 a4345e5759 first commit 5 vuotta sitten 3440 a4345e5759 first commit 5 vuotta sitten 3455 a4345e5759 first commit 5 vuotta sitten 3456 a4345e5759 first commit 5 vuotta sitten 3456_fsm a4345e5759 first commit 5 vuotta sitten 3456_vm a4345e5759 first commit 5 vuotta sitten 3466 a4345e5759 first commit 5 vuotta sitten 3467 a4345e5759 first commit 5 vuotta sitten 3468 a4345e5759 first commit 5 vuotta sitten 3501 a4345e5759 first commit 5 vuotta sitten 3502 a4345e5759 first commit 5 vuotta sitten 3503 a4345e5759 first commit 5 vuotta sitten 3534 a4345e5759 first commit 5 vuotta sitten 3541 a4345e5759 first commit 5 vuotta sitten 3541_fsm a4345e5759 first commit 5 vuotta sitten 3541_vm a4345e5759 first commit 5 vuotta sitten 3542 a4345e5759 first commit 5 vuotta sitten 3574 a4345e5759 first commit 5 vuotta sitten 3575 a4345e5759 first commit 5 vuotta sitten 3576 a4345e5759 first commit 5 vuotta sitten 3596 a4345e5759 first commit 5 vuotta sitten 3597 a4345e5759 first commit 5 vuotta sitten 3598 a4345e5759 first commit 5 vuotta sitten 3599 a4345e5759 first commit 5 vuotta sitten 3600 a4345e5759 first commit 5 vuotta sitten 3600_fsm a4345e5759 first commit 5 vuotta sitten 3600_vm a4345e5759 first commit 5 vuotta sitten 3601 a4345e5759 first commit 5 vuotta sitten 3601_fsm a4345e5759 first commit 5 vuotta sitten 3601_vm a4345e5759 first commit 5 vuotta sitten 3602 a4345e5759 first commit 5 vuotta sitten 3602_fsm a4345e5759 first commit 5 vuotta sitten 3602_vm a4345e5759 first commit 5 vuotta sitten 3603 a4345e5759 first commit 5 vuotta sitten 3603_fsm a4345e5759 first commit 5 vuotta sitten 3603_vm a4345e5759 first commit 5 vuotta sitten 3604 a4345e5759 first commit 5 vuotta sitten 3605 a4345e5759 first commit 5 vuotta sitten 3606 a4345e5759 first commit 5 vuotta sitten 3607 a4345e5759 first commit 5 vuotta sitten 3608 a4345e5759 first commit 5 vuotta sitten 3609 a4345e5759 first commit 5 vuotta sitten 3712 a4345e5759 first commit 5 vuotta sitten 3764 a4345e5759 first commit 5 vuotta sitten 3764_fsm a4345e5759 first commit 5 vuotta sitten 3764_vm a4345e5759 first commit 5 vuotta sitten 3766 a4345e5759 first commit 5 vuotta sitten 3767 a4345e5759 first commit 5 vuotta sitten 3997 a4345e5759 first commit 5 vuotta sitten 4143 a4345e5759 first commit 5 vuotta sitten 4144 a4345e5759 first commit 5 vuotta sitten 4145 a4345e5759 first commit 5 vuotta sitten 4146 a4345e5759 first commit 5 vuotta sitten 4147 a4345e5759 first commit 5 vuotta sitten 4148 a4345e5759 first commit 5 vuotta sitten 4149 a4345e5759 first commit 5 vuotta sitten 4150 a4345e5759 first commit 5 vuotta sitten 4151 a4345e5759 first commit 5 vuotta sitten 4152 a4345e5759 first commit 5 vuotta sitten 4153 a4345e5759 first commit 5 vuotta sitten 4154 a4345e5759 first commit 5 vuotta sitten 4155 a4345e5759 first commit 5 vuotta sitten 4156 a4345e5759 first commit 5 vuotta sitten 4157 a4345e5759 first commit 5 vuotta sitten 4158 a4345e5759 first commit 5 vuotta sitten 4159 a4345e5759 first commit 5 vuotta sitten 4160 a4345e5759 first commit 5 vuotta sitten 4161 a4345e5759 first commit 5 vuotta sitten 4162 a4345e5759 first commit 5 vuotta sitten 4163 a4345e5759 first commit 5 vuotta sitten 4164 a4345e5759 first commit 5 vuotta sitten 4165 a4345e5759 first commit 5 vuotta sitten 4166 a4345e5759 first commit 5 vuotta sitten 4167 a4345e5759 first commit 5 vuotta sitten 4168 a4345e5759 first commit 5 vuotta sitten 4169 a4345e5759 first commit 5 vuotta sitten 4170 a4345e5759 first commit 5 vuotta sitten 4171 a4345e5759 first commit 5 vuotta sitten 4172 a4345e5759 first commit 5 vuotta sitten 4173 a4345e5759 first commit 5 vuotta sitten 4174 a4345e5759 first commit 5 vuotta sitten 5002 a4345e5759 first commit 5 vuotta sitten 548 a4345e5759 first commit 5 vuotta sitten 549 a4345e5759 first commit 5 vuotta sitten 6102 a4345e5759 first commit 5 vuotta sitten 6104 a4345e5759 first commit 5 vuotta sitten 6106 a4345e5759 first commit 5 vuotta sitten 6110 a4345e5759 first commit 5 vuotta sitten 6111 a4345e5759 first commit 5 vuotta sitten 6112 a4345e5759 first commit 5 vuotta sitten 6113 a4345e5759 first commit 5 vuotta sitten 6117 a4345e5759 first commit 5 vuotta sitten 826 a4345e5759 first commit 5 vuotta sitten 827 a4345e5759 first commit 5 vuotta sitten 828 a4345e5759 first commit 5 vuotta sitten PG_VERSION a4345e5759 first commit 5 vuotta sitten pg_filenode.map a4345e5759 first commit 5 vuotta sitten tum/whitesports - Gogs: Simplico Git Service

Aucune description

options-privacy.php 9.1KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298
  1. <?php
  2. /**
  3. * Privacy Settings Screen.
  4. *
  5. * @package WordPress
  6. * @subpackage Administration
  7. */
  8. /** WordPress Administration Bootstrap */
  9. require_once __DIR__ . '/admin.php';
  10. if ( ! current_user_can( 'manage_privacy_options' ) ) {
  11. wp_die( __( 'Sorry, you are not allowed to manage privacy options on this site.' ) );
  12. }
  13. if ( isset( $_GET['tab'] ) && 'policyguide' === $_GET['tab'] ) {
  14. require_once dirname( __FILE__ ) . '/privacy-policy-guide.php';
  15. return;
  16. }
  17. add_filter(
  18. 'admin_body_class',
  19. function( $body_class ) {
  20. $body_class .= ' privacy-settings ';
  21. return $body_class;
  22. }
  23. );
  24. $action = isset( $_POST['action'] ) ? $_POST['action'] : '';
  25. if ( ! empty( $action ) ) {
  26. check_admin_referer( $action );
  27. if ( 'set-privacy-page' === $action ) {
  28. $privacy_policy_page_id = isset( $_POST['page_for_privacy_policy'] ) ? (int) $_POST['page_for_privacy_policy'] : 0;
  29. update_option( 'wp_page_for_privacy_policy', $privacy_policy_page_id );
  30. $privacy_page_updated_message = __( 'Privacy Policy page updated successfully.' );
  31. if ( $privacy_policy_page_id ) {
  32. /*
  33. * Don't always link to the menu customizer:
  34. *
  35. * - Unpublished pages can't be selected by default.
  36. * - `WP_Customize_Nav_Menus::__construct()` checks the user's capabilities.
  37. * - Themes might not "officially" support menus.
  38. */
  39. if (
  40. 'publish' === get_post_status( $privacy_policy_page_id )
  41. && current_user_can( 'edit_theme_options' )
  42. && current_theme_supports( 'menus' )
  43. ) {
  44. $privacy_page_updated_message = sprintf(
  45. /* translators: %s: URL to Customizer -> Menus. */
  46. __( 'Privacy Policy page setting updated successfully. Remember to <a href="%s">update your menus</a>!' ),
  47. esc_url( add_query_arg( 'autofocus[panel]', 'nav_menus', admin_url( 'customize.php' ) ) )
  48. );
  49. }
  50. }
  51. add_settings_error( 'page_for_privacy_policy', 'page_for_privacy_policy', $privacy_page_updated_message, 'success' );
  52. } elseif ( 'create-privacy-page' === $action ) {
  53. if ( ! class_exists( 'WP_Privacy_Policy_Content' ) ) {
  54. require_once ABSPATH . 'wp-admin/includes/class-wp-privacy-policy-content.php';
  55. }
  56. $privacy_policy_page_content = WP_Privacy_Policy_Content::get_default_content();
  57. $privacy_policy_page_id = wp_insert_post(
  58. array(
  59. 'post_title' => __( 'Privacy Policy' ),
  60. 'post_status' => 'draft',
  61. 'post_type' => 'page',
  62. 'post_content' => $privacy_policy_page_content,
  63. ),
  64. true
  65. );
  66. if ( is_wp_error( $privacy_policy_page_id ) ) {
  67. add_settings_error(
  68. 'page_for_privacy_policy',
  69. 'page_for_privacy_policy',
  70. __( 'Unable to create a Privacy Policy page.' ),
  71. 'error'
  72. );
  73. } else {
  74. update_option( 'wp_page_for_privacy_policy', $privacy_policy_page_id );
  75. wp_redirect( admin_url( 'post.php?post=' . $privacy_policy_page_id . '&action=edit' ) );
  76. exit;
  77. }
  78. }
  79. }
  80. // If a Privacy Policy page ID is available, make sure the page actually exists. If not, display an error.
  81. $privacy_policy_page_exists = false;
  82. $privacy_policy_page_id = (int) get_option( 'wp_page_for_privacy_policy' );
  83. if ( ! empty( $privacy_policy_page_id ) ) {
  84. $privacy_policy_page = get_post( $privacy_policy_page_id );
  85. if ( ! $privacy_policy_page instanceof WP_Post ) {
  86. add_settings_error(
  87. 'page_for_privacy_policy',
  88. 'page_for_privacy_policy',
  89. __( 'The currently selected Privacy Policy page does not exist. Please create or select a new page.' ),
  90. 'error'
  91. );
  92. } else {
  93. if ( 'trash' === $privacy_policy_page->post_status ) {
  94. add_settings_error(
  95. 'page_for_privacy_policy',
  96. 'page_for_privacy_policy',
  97. sprintf(
  98. /* translators: %s: URL to Pages Trash. */
  99. __( 'The currently selected Privacy Policy page is in the Trash. Please create or select a new Privacy Policy page or <a href="%s">restore the current page</a>.' ),
  100. 'edit.php?post_status=trash&post_type=page'
  101. ),
  102. 'error'
  103. );
  104. } else {
  105. $privacy_policy_page_exists = true;
  106. }
  107. }
  108. }
  109. $parent_file = 'options-general.php';
  110. wp_enqueue_script( 'privacy-tools' );
  111. require_once ABSPATH . 'wp-admin/admin-header.php';
  112. ?>
  113. <div class="privacy-settings-header">
  114. <div class="privacy-settings-title-section">
  115. <h1>
  116. <?php _e( 'Privacy' ); ?>
  117. </h1>
  118. </div>
  119. <nav class="privacy-settings-tabs-wrapper hide-if-no-js" aria-label="<?php esc_attr_e( 'Secondary menu' ); ?>">
  120. <a href="<?php echo esc_url( admin_url( 'options-privacy.php' ) ); ?>" class="privacy-settings-tab active" aria-current="true">
  121. <?php
  122. /* translators: Tab heading for Site Health Status page. */
  123. _ex( 'Settings', 'Privacy Settings' );
  124. ?>
  125. </a>
  126. <a href="<?php echo esc_url( admin_url( 'options-privacy.php?tab=policyguide' ) ); ?>" class="privacy-settings-tab">
  127. <?php
  128. /* translators: Tab heading for Site Health Status page. */
  129. _ex( 'Policy Guide', 'Privacy Settings' );
  130. ?>
  131. </a>
  132. </nav>
  133. </div>
  134. <hr class="wp-header-end">
  135. <div class="notice notice-error hide-if-js">
  136. <p><?php _e( 'The Privacy Settings require JavaScript.' ); ?></p>
  137. </div>
  138. <div class="privacy-settings-body hide-if-no-js">
  139. <h2><?php _e( 'Privacy Settings' ); ?></h2>
  140. <p>
  141. <?php _e( 'As a website owner, you may need to follow national or international privacy laws. For example, you may need to create and display a Privacy Policy.' ); ?>
  142. <?php _e( 'If you already have a Privacy Policy page, please select it below. If not, please create one.' ); ?>
  143. </p>
  144. <p>
  145. <?php _e( 'The new page will include help and suggestions for your Privacy Policy.' ); ?>
  146. <?php _e( 'However, it is your responsibility to use those resources correctly, to provide the information that your Privacy Policy requires, and to keep that information current and accurate.' ); ?>
  147. </p>
  148. <p>
  149. <?php _e( 'After your Privacy Policy page is set, we suggest that you edit it.' ); ?>
  150. <?php _e( 'We would also suggest reviewing your Privacy Policy from time to time, especially after installing or updating any themes or plugins. There may be changes or new suggested information for you to consider adding to your policy.' ); ?>
  151. </p>
  152. <p>
  153. <?php
  154. if ( $privacy_policy_page_exists ) {
  155. $edit_href = add_query_arg(
  156. array(
  157. 'post' => $privacy_policy_page_id,
  158. 'action' => 'edit',
  159. ),
  160. admin_url( 'post.php' )
  161. );
  162. $view_href = get_permalink( $privacy_policy_page_id );
  163. ?>
  164. <strong>
  165. <?php
  166. if ( 'publish' === get_post_status( $privacy_policy_page_id ) ) {
  167. printf(
  168. /* translators: 1: URL to edit Privacy Policy page, 2: URL to view Privacy Policy page. */
  169. __( '<a href="%1$s">Edit</a> or <a href="%2$s">view</a> your Privacy Policy page content.' ),
  170. esc_url( $edit_href ),
  171. esc_url( $view_href )
  172. );
  173. } else {
  174. printf(
  175. /* translators: 1: URL to edit Privacy Policy page, 2: URL to preview Privacy Policy page. */
  176. __( '<a href="%1$s">Edit</a> or <a href="%2$s">preview</a> your Privacy Policy page content.' ),
  177. esc_url( $edit_href ),
  178. esc_url( $view_href )
  179. );
  180. }
  181. ?>
  182. </strong>
  183. <?php
  184. }
  185. printf(
  186. /* translators: 1: Privacy Policy guide URL, 2: Additional link attributes, 3: Accessibility text. */
  187. __( 'Need help putting together your new Privacy Policy page? <a href="%1$s" %2$s>Check out our Privacy Policy guide%3$s</a> for recommendations on what content to include, along with policies suggested by your plugins and theme.' ),
  188. esc_url( admin_url( 'options-privacy.php?tab=policyguide' ) ),
  189. '',
  190. ''
  191. );
  192. ?>
  193. </p>
  194. <hr>
  195. <?php
  196. $has_pages = (bool) get_posts(
  197. array(
  198. 'post_type' => 'page',
  199. 'posts_per_page' => 1,
  200. 'post_status' => array(
  201. 'publish',
  202. 'draft',
  203. ),
  204. )
  205. );
  206. ?>
  207. <table class="form-table tools-privacy-policy-page" role="presentation">
  208. <tr>
  209. <th scope="row">
  210. <label for="create-page">
  211. <?php
  212. if ( $has_pages ) {
  213. _e( 'Create a new Privacy Policy Page' );
  214. } else {
  215. _e( 'There are no pages.' );
  216. }
  217. ?>
  218. </label>
  219. </th>
  220. <td>
  221. <form class="wp-create-privacy-page" method="post" action="">
  222. <input type="hidden" name="action" value="create-privacy-page" />
  223. <?php
  224. wp_nonce_field( 'create-privacy-page' );
  225. submit_button( __( 'Create' ), 'secondary', 'submit', false, array( 'id' => 'create-page' ) );
  226. ?>
  227. </form>
  228. </td>
  229. </tr>
  230. <?php if ( $has_pages ) : ?>
  231. <tr>
  232. <th scope="row">
  233. <label for="page_for_privacy_policy">
  234. <?php
  235. if ( $privacy_policy_page_exists ) {
  236. _e( 'Change your Privacy Policy page' );
  237. } else {
  238. _e( 'Select a Privacy Policy page' );
  239. }
  240. ?>
  241. </label>
  242. </th>
  243. <td>
  244. <form method="post" action="">
  245. <input type="hidden" name="action" value="set-privacy-page" />
  246. <?php
  247. wp_dropdown_pages(
  248. array(
  249. 'name' => 'page_for_privacy_policy',
  250. 'show_option_none' => __( '&mdash; Select &mdash;' ),
  251. 'option_none_value' => '0',
  252. 'selected' => $privacy_policy_page_id,
  253. 'post_status' => array( 'draft', 'publish' ),
  254. )
  255. );
  256. wp_nonce_field( 'set-privacy-page' );
  257. submit_button( __( 'Use This Page' ), 'primary', 'submit', false, array( 'id' => 'set-page' ) );
  258. ?>
  259. </form>
  260. </td>
  261. </tr>
  262. <?php endif; ?>
  263. </table>
  264. </div>
  265. <?php
  266. require_once ABSPATH . 'wp-admin/admin-footer.php';