Privacy: Add an admin pointer for new privacy features in 4.9.6.

The new features are very important for some users, because of their GDPR obligations. They're also spread across multiple top-level menus, making them less discoverable. An admin pointer will help to ensure that users are aware of the new tools and how to find them.

Props desrosj, andreamiddleton, allendav, xkon. 
Fixes #43942.


git-svn-id: https://develop.svn.wordpress.org/trunk@43158 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Ian Dunn 2018-05-03 19:44:36 +00:00
parent a7fcbcae89
commit 97eeed489d
2 changed files with 43 additions and 2 deletions

View File

@ -41,7 +41,7 @@ final class WP_Internal_Pointers {
* )
*/
$registered_pointers = array(
// None currently
'index.php' => 'wp496_privacy',
);
// Check if screen related pointer is registered
@ -65,7 +65,11 @@ final class WP_Internal_Pointers {
* )
*/
$caps_required = array(
// None currently
'wp496_privacy' => array(
'manage_privacy_options',
'export_others_personal_data',
'erase_others_personal_data',
),
);
// Get dismissed pointers
@ -151,6 +155,39 @@ final class WP_Internal_Pointers {
public static function pointer_wp390_widgets() {}
public static function pointer_wp410_dfw() {}
/**
* Display a pointer for the new privacy tools.
*
* @since 4.9.6
*/
public static function pointer_wp496_privacy() {
$content = '<h3>' . __( 'Privacy and Personal Data' ) . '</h3>';
$content .= '<h4>' . __( 'Privacy Policy' ) . '</h4>';
$content .= '<p>' . __( 'Create or select your site&#8217;s privacy policy page under <strong>Settings &gt; Privacy</strong> to keep your users informed and aware.' ) . '</p>';
$content .= '<h4>' . __( 'Personal Data Export and Erasure' ) . '</h4>';
$content .= '<p>' . __( 'New <strong>Tools</strong> have been added to help you with personal data export and erasure requests.' ) . '</p>';
if ( is_rtl() ) {
$position = array(
'edge' => 'right',
'align' => 'left',
'at' => 'left+40',
);
} else {
$position = array(
'edge' => 'left',
'align' => 'right',
'at' => 'right-40 bottom'
);
}
$js_args = array(
'content' => $content,
'position' => $position,
);
self::print_js( 'wp496_privacy', '#menu-tools', $js_args );
}
/**
* Prevents new users from seeing existing 'new feature' pointers.
*

View File

@ -36,6 +36,10 @@
-moz-osx-font-smoothing: grayscale;
}
.wp-pointer-content h4 {
margin: 1.33em 15px;
}
.wp-pointer-content p {
padding: 0 15px;
}