Make WordPress Core

Changeset 43159


Ignore:
Timestamp:
05/03/2018 07:51:10 PM (6 years ago)
Author:
azaozz
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.
Merges [43158] to the 4.9 branch.
Fixes #43942.

Location:
branches/4.9
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • branches/4.9

  • branches/4.9/src/wp-admin/includes/class-wp-internal-pointers.php

    r34426 r43159  
    4444         */
    4545        $registered_pointers = array(
    46             // None currently
     46            'index.php' => 'wp496_privacy',
    4747        );
    4848
     
    6767         */
    6868        $caps_required = array(
    69             // None currently
     69            'wp496_privacy' => array(
     70                'manage_privacy_options',
     71                'export_others_personal_data',
     72                'erase_others_personal_data',
     73            ),
    7074        );
    7175
     
    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     *
  • branches/4.9/src/wp-includes/css/wp-pointer.css

    r41062 r43159  
    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.