diff --git src/wp-admin/includes/admin-filters.php src/wp-admin/includes/admin-filters.php
index 68592b6d41..9d45dc63af 100644
|
|
|
add_filter( 'wp_privacy_personal_data_export_page', 'wp_privacy_process_personal |
| 138 | 138 | add_action( 'wp_privacy_personal_data_export_file', 'wp_privacy_generate_personal_data_export_file', 10 ); |
| 139 | 139 | |
| 140 | 140 | // Privacy policy text changes check. |
| 141 | | add_action( 'admin_init', array( 'WP_Privacy_Policy_Content', 'text_change_check' ), 20 ); |
| | 141 | //add_action( 'admin_init', array( 'WP_Privacy_Policy_Content', 'text_change_check' ), 20 ); |
| 142 | 142 | |
| 143 | 143 | // Show a "postbox" with the text suggestions for a privacy policy. |
| 144 | 144 | add_action( 'edit_form_after_title', array( 'WP_Privacy_Policy_Content', 'notice' ) ); |
diff --git src/wp-admin/includes/misc.php src/wp-admin/includes/misc.php
index ff8e78a98e..6aa69a8f30 100644
|
|
|
final class WP_Privacy_Policy_Content { |
| 1320 | 1320 | |
| 1321 | 1321 | // The site doesn't have a privacy policy. |
| 1322 | 1322 | if ( empty( $policy_page_id ) ) { |
| 1323 | | return; |
| | 1323 | return false; |
| 1324 | 1324 | } |
| 1325 | 1325 | |
| 1326 | 1326 | if ( ! current_user_can( 'edit_post', $policy_page_id ) ) { |
| 1327 | | return; |
| | 1327 | return false; |
| 1328 | 1328 | } |
| 1329 | 1329 | |
| 1330 | | // Also run when the option doesn't exist yet. |
| 1331 | | if ( get_option( '_wp_privacy_text_change_check' ) === 'no-check' ) { |
| 1332 | | return; |
| 1333 | | } |
| | 1330 | // // Also run when the option doesn't exist yet. |
| | 1331 | // if ( get_option( '_wp_privacy_text_change_check' ) === 'no-check' ) { |
| | 1332 | // return true; |
| | 1333 | // } |
| 1334 | 1334 | |
| 1335 | 1335 | $old = (array) get_post_meta( $policy_page_id, '_wp_suggested_privacy_policy_content' ); |
| 1336 | 1336 | $new = self::$policy_content; |
| … |
… |
final class WP_Privacy_Policy_Content { |
| 1346 | 1346 | // The == operator (equal, not identical) was used intentionally. |
| 1347 | 1347 | // See http://php.net/manual/en/language.operators.array.php |
| 1348 | 1348 | if ( $new != $old ) { |
| 1349 | | // A plugin was activated or deactivated, or some policy text has changed. |
| 1350 | | // Show a notice on all screens in wp-admin. |
| 1351 | | add_action( 'admin_notices', array( 'WP_Privacy_Policy_Content', 'policy_text_changed_notice' ) ); |
| | 1349 | return true; |
| 1352 | 1350 | } else { |
| 1353 | | // Stop checking. |
| 1354 | | update_option( '_wp_privacy_text_change_check', 'no-check' ); |
| | 1351 | return false; |
| 1355 | 1352 | } |
| 1356 | 1353 | } |
| 1357 | 1354 | |
| … |
… |
final class WP_Privacy_Policy_Content { |
| 1360 | 1357 | * |
| 1361 | 1358 | * @since 4.9.6 |
| 1362 | 1359 | */ |
| 1363 | | public static function policy_text_changed_notice() { |
| | 1360 | public static function x_policy_text_changed_notice() { |
| | 1361 | return; |
| 1364 | 1362 | global $post; |
| | 1363 | |
| 1365 | 1364 | $policy_page_id = (int) get_option( 'wp_page_for_privacy_policy' ); |
| | 1365 | $relevant_screens = array( 'privacy', 'edit-page' ); |
| | 1366 | $current_screen = get_current_screen(); |
| | 1367 | var_dump($current_screen);wp_die(); |
| | 1368 | // if on privacy policy page, then show, b/c otherwise nothing on that page says it |
| | 1369 | |
| | 1370 | if ( ! is_a( $current_screen, 'WP_Screen' ) ) { |
| | 1371 | return; |
| | 1372 | } |
| | 1373 | |
| | 1374 | if ( ! in_array( $current_screen->id, $relevant_screens, true ) ) { |
| | 1375 | return; |
| | 1376 | } |
| 1366 | 1377 | |
| 1367 | 1378 | ?> |
| 1368 | 1379 | <div class="policy-text-updated notice notice-warning is-dismissible"> |
diff --git src/wp-admin/menu.php src/wp-admin/menu.php
index 0ad302ebda..a66cc63127 100644
|
|
|
if ( ! is_multisite() && defined( 'WP_ALLOW_MULTISITE' ) && WP_ALLOW_MULTISITE ) |
| 263 | 263 | $submenu['tools.php'][50] = array( __( 'Network Setup' ), 'setup_network', 'network.php' ); |
| 264 | 264 | } |
| 265 | 265 | |
| 266 | | $menu[80] = array( __( 'Settings' ), 'manage_options', 'options-general.php', '', 'menu-top menu-icon-settings', 'menu-settings', 'dashicons-admin-settings' ); |
| | 266 | $policy_change_notice = current_user_can( 'manage_privacy_options' ) && WP_Privacy_Policy_Content::text_change_check() |
| | 267 | ? " <span class='update-plugins count-1}'><span class='plugin-count'>" . number_format_i18n( 1 ) . '</span></span>' |
| | 268 | : ''; |
| | 269 | $menu[80] = array( __( 'Settings' . $policy_change_notice ), 'manage_options', 'options-general.php', '', 'menu-top menu-icon-settings', 'menu-settings', 'dashicons-admin-settings' ); |
| 267 | 270 | $submenu['options-general.php'][10] = array( _x( 'General', 'settings screen' ), 'manage_options', 'options-general.php' ); |
| 268 | 271 | $submenu['options-general.php'][15] = array( __( 'Writing' ), 'manage_options', 'options-writing.php' ); |
| 269 | 272 | $submenu['options-general.php'][20] = array( __( 'Reading' ), 'manage_options', 'options-reading.php' ); |
| 270 | 273 | $submenu['options-general.php'][25] = array( __( 'Discussion' ), 'manage_options', 'options-discussion.php' ); |
| 271 | 274 | $submenu['options-general.php'][30] = array( __( 'Media' ), 'manage_options', 'options-media.php' ); |
| 272 | 275 | $submenu['options-general.php'][40] = array( __( 'Permalinks' ), 'manage_options', 'options-permalink.php' ); |
| 273 | | $submenu['options-general.php'][45] = array( __( 'Privacy' ), 'manage_privacy_options', 'privacy.php' ); |
| | 276 | $submenu['options-general.php'][45] = array( __( 'Privacy' ) . $policy_change_notice, 'manage_privacy_options', 'privacy.php' ); |
| 274 | 277 | |
| 275 | 278 | $_wp_last_utility_menu = 80; // The index of the last top-level menu in the utility menu group |
| 276 | 279 | |