WordPress.org

Make WordPress Core

Changeset 43158


Ignore:
Timestamp:
05/03/2018 07:44:36 PM (2 years ago)
Author:
iandunn
Message:

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.

Location:
trunk/src
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/includes/class-wp-internal-pointers.php

    r42745 r43158  
    4242         */
    4343        $registered_pointers = array(
    44             // None currently
     44            'index.php' => 'wp496_privacy',
    4545        );
    4646
     
    6666         */
    6767        $caps_required = array(
    68             // None currently
     68            'wp496_privacy' => array(
     69                'manage_privacy_options',
     70                'export_others_personal_data',
     71                'erase_others_personal_data',
     72            ),
    6973        );
    7074
     
    153157
    154158    /**
     159     * Display a pointer for the new privacy tools.
     160     *
     161     * @since 4.9.6
     162     */
     163    public static function pointer_wp496_privacy() {
     164        $content  = '<h3>' . __( 'Privacy and Personal Data' ) . '</h3>';
     165        $content .= '<h4>' . __( 'Privacy Policy' ) . '</h4>';
     166        $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>';
     167        $content .= '<h4>' . __( 'Personal Data Export and Erasure' ) . '</h4>';
     168        $content .= '<p>' . __( 'New <strong>Tools</strong> have been added to help you with personal data export and erasure requests.' ) . '</p>';
     169
     170        if ( is_rtl() ) {
     171            $position = array(
     172                'edge'  => 'right',
     173                'align' => 'left',
     174                'at'    => 'left+40',
     175            );
     176        } else {
     177            $position = array(
     178                'edge'  => 'left',
     179                'align' => 'right',
     180                'at'    => 'right-40 bottom'
     181            );
     182        }
     183
     184        $js_args = array(
     185            'content'  => $content,
     186            'position' => $position,
     187        );
     188        self::print_js( 'wp496_privacy', '#menu-tools', $js_args );
     189    }
     190
     191    /**
    155192     * Prevents new users from seeing existing 'new feature' pointers.
    156193     *
  • trunk/src/wp-includes/css/wp-pointer.css

    r41062 r43158  
    3737}
    3838
     39.wp-pointer-content h4 {
     40    margin: 1.33em 15px;
     41}
     42
    3943.wp-pointer-content p {
    4044    padding: 0 15px;
Note: See TracChangeset for help on using the changeset viewer.