Make WordPress Core

Ticket #43942: 43942.2.diff

File 43942.2.diff, 2.3 KB (added by desrosj, 8 years ago)
  • src/wp-admin/includes/class-wp-internal-pointers.php

     
    4141                 *     )
    4242                 */
    4343                $registered_pointers = array(
    44                         // None currently
     44                        'index.php' => array(
     45                                'wp496_privacy_tools',
     46                                'wp496_privacy_settings',
     47                        )
    4548                );
    4649
    4750                // Check if screen related pointer is registered
     
    6568                 *     )
    6669                 */
    6770                $caps_required = array(
    68                         // None currently
     71                        'wp496_privacy_settings' => array( 'manage_options' ),
     72                        'wp496_privacy_tools'    => array( 'manage_options' ),
    6973                );
    7074
    7175                // Get dismissed pointers
     
    152156        public static function pointer_wp410_dfw() {}
    153157
    154158        /**
     159         * Display a pointer for the privacy settings page.
     160         *
     161         * @since 4.9.6
     162         */
     163        public static function pointer_wp496_privacy_settings() {
     164                $content  = '<h3>' . __( 'Privacy Policy' ) . '</h3>';
     165                $content .= '<p>' . __( 'Easily select a privacy policy page to inform your users of their rights.' ) . '</p>';
     166
     167                if ( is_rtl() ) {
     168                        $position = array(
     169                                'edge' => 'right',
     170                                'align' => 'left',
     171                                'at' => 'left+40',
     172                        );
     173                } else {
     174                        $position = array(
     175                                'edge' => 'left',
     176                                'align' => 'right',
     177                                'at' => 'right-40',
     178                        );
     179                }
     180
     181                self::print_js( 'wp496_privacy_settings', '#menu-settings', array(
     182                        'content' => $content,
     183                        'position' => $position,
     184                ) );
     185        }
     186
     187        /**
     188         * Display a pointer for the new privacy tools.
     189         *
     190         * @since 4.9.6
     191         */
     192        public static function pointer_wp496_privacy_tools() {
     193                $content  = '<h3>' . __( 'Privacy Tools' ) . '</h3>';
     194                $content .= '<p>' . __( 'New tools have been added to help with personal data export and erasure requests.' ) . '</p>';
     195
     196                if ( is_rtl() ) {
     197                        $position = array(
     198                                'edge'  => 'right',
     199                                'align' => 'left',
     200                                'at'    => 'left+40',
     201                        );
     202                } else {
     203                        $position = array(
     204                                'edge'  => 'left',
     205                                'align' => 'right',
     206                                'at'    => 'right-40'
     207                        );
     208                }
     209
     210                self::print_js( 'wp496_privacy_tools', '#menu-tools', array(
     211                        'content' => $content,
     212                        'position' => $position,
     213                ) );
     214        }
     215
     216        /**
    155217         * Prevents new users from seeing existing 'new feature' pointers.
    156218         *
    157219         * @since 3.3.0