12 if ( ! current_user_can( 'manage_privacy_options' ) ) { |
12 if ( ! current_user_can( 'manage_privacy_options' ) ) { |
13 wp_die( __( 'Sorry, you are not allowed to manage privacy options on this site.' ) ); |
13 wp_die( __( 'Sorry, you are not allowed to manage privacy options on this site.' ) ); |
14 } |
14 } |
15 |
15 |
16 if ( isset( $_GET['tab'] ) && 'policyguide' === $_GET['tab'] ) { |
16 if ( isset( $_GET['tab'] ) && 'policyguide' === $_GET['tab'] ) { |
17 require_once dirname( __FILE__ ) . '/privacy-policy-guide.php'; |
17 require_once __DIR__ . '/privacy-policy-guide.php'; |
18 return; |
18 return; |
19 } |
19 } |
20 |
20 |
|
21 // Used in the HTML title tag. |
|
22 $title = __( 'Privacy' ); |
|
23 |
21 add_filter( |
24 add_filter( |
22 'admin_body_class', |
25 'admin_body_class', |
23 static function( $body_class ) { |
26 static function ( $body_class ) { |
24 $body_class .= ' privacy-settings '; |
27 $body_class .= ' privacy-settings '; |
25 |
28 |
26 return $body_class; |
29 return $body_class; |
27 } |
30 } |
28 ); |
31 ); |
39 ) |
42 ) |
40 ); |
43 ); |
41 |
44 |
42 get_current_screen()->set_help_sidebar( |
45 get_current_screen()->set_help_sidebar( |
43 '<p><strong>' . __( 'For more information:' ) . '</strong></p>' . |
46 '<p><strong>' . __( 'For more information:' ) . '</strong></p>' . |
44 '<p>' . __( '<a href="https://wordpress.org/support/article/settings-privacy-screen/">Documentation on Privacy Settings</a>' ) . '</p>' |
47 '<p>' . __( '<a href="https://wordpress.org/documentation/article/settings-privacy-screen/">Documentation on Privacy Settings</a>' ) . '</p>' |
45 ); |
48 ); |
46 |
49 |
47 if ( ! empty( $action ) ) { |
50 if ( ! empty( $action ) ) { |
48 check_admin_referer( $action ); |
51 check_admin_referer( $action ); |
49 |
52 |
172 </nav> |
175 </nav> |
173 </div> |
176 </div> |
174 |
177 |
175 <hr class="wp-header-end"> |
178 <hr class="wp-header-end"> |
176 |
179 |
177 <div class="notice notice-error hide-if-js"> |
180 <?php |
178 <p><?php _e( 'The Privacy Settings require JavaScript.' ); ?></p> |
181 wp_admin_notice( |
179 </div> |
182 __( 'The Privacy Settings require JavaScript.' ), |
|
183 array( |
|
184 'type' => 'error', |
|
185 'additional_classes' => array( 'hide-if-js' ), |
|
186 ) |
|
187 ); |
|
188 ?> |
180 |
189 |
181 <div class="privacy-settings-body hide-if-no-js"> |
190 <div class="privacy-settings-body hide-if-no-js"> |
182 <h2><?php _e( 'Privacy Settings' ); ?></h2> |
191 <h2><?php _e( 'Privacy Settings' ); ?></h2> |
183 <p> |
192 <p> |
184 <?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.' ); ?> |
193 <?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.' ); ?> |
185 <?php _e( 'If you already have a Privacy Policy page, please select it below. If not, please create one.' ); ?> |
194 <?php _e( 'If you already have a Privacy Policy page, please select it below. If not, please create one.' ); ?> |
186 </p> |
195 </p> |
187 <p> |
196 <p> |
188 <?php _e( 'The new page will include help and suggestions for your Privacy Policy.' ); ?> |
197 <?php _e( 'The new page will include help and suggestions for your privacy policy.' ); ?> |
189 <?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.' ); ?> |
198 <?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.' ); ?> |
190 </p> |
199 </p> |
191 <p> |
200 <p> |
192 <?php _e( 'After your Privacy Policy page is set, you should edit it.' ); ?> |
201 <?php _e( 'After your Privacy Policy page is set, you should edit it.' ); ?> |
193 <?php _e( 'You should also review 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.' ); ?> |
202 <?php _e( 'You should also review 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.' ); ?> |
194 </p> |
203 </p> |
195 <p> |
204 <p> |
196 <?php |
205 <?php |
197 if ( $privacy_policy_page_exists ) { |
206 if ( $privacy_policy_page_exists ) { |
198 $edit_href = add_query_arg( |
207 $edit_href = add_query_arg( |
225 </strong> |
234 </strong> |
226 <?php |
235 <?php |
227 } |
236 } |
228 printf( |
237 printf( |
229 /* translators: 1: Privacy Policy guide URL, 2: Additional link attributes, 3: Accessibility text. */ |
238 /* translators: 1: Privacy Policy guide URL, 2: Additional link attributes, 3: Accessibility text. */ |
230 __( '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.' ), |
239 __( '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.' ), |
231 esc_url( admin_url( 'options-privacy.php?tab=policyguide' ) ), |
240 esc_url( admin_url( 'options-privacy.php?tab=policyguide' ) ), |
232 '', |
241 '', |
233 '' |
242 '' |
234 ); |
243 ); |
235 ?> |
244 ?> |
251 <tr> |
260 <tr> |
252 <th scope="row"> |
261 <th scope="row"> |
253 <label for="create-page"> |
262 <label for="create-page"> |
254 <?php |
263 <?php |
255 if ( $has_pages ) { |
264 if ( $has_pages ) { |
256 _e( 'Create a new Privacy Policy Page' ); |
265 _e( 'Create a new Privacy Policy page' ); |
257 } else { |
266 } else { |
258 _e( 'There are no pages.' ); |
267 _e( 'There are no pages.' ); |
259 } |
268 } |
260 ?> |
269 ?> |
261 </label> |
270 </label> |
262 </th> |
271 </th> |
263 <td> |
272 <td> |
264 <form class="wp-create-privacy-page" method="post" action=""> |
273 <form class="wp-create-privacy-page" method="post"> |
265 <input type="hidden" name="action" value="create-privacy-page" /> |
274 <input type="hidden" name="action" value="create-privacy-page" /> |
266 <?php |
275 <?php |
267 wp_nonce_field( 'create-privacy-page' ); |
276 wp_nonce_field( 'create-privacy-page' ); |
268 submit_button( __( 'Create' ), 'secondary', 'submit', false, array( 'id' => 'create-page' ) ); |
277 submit_button( __( 'Create' ), 'secondary', 'submit', false, array( 'id' => 'create-page' ) ); |
269 ?> |
278 ?> |