Make WordPress Core

Changeset 42978


Ignore:
Timestamp:
04/13/2018 05:55:25 PM (8 years ago)
Author:
azaozz
Message:

Privacy: improve the screen for setting a privacy policy page.

Props melchoyce, xkon, azaozz.
See #43435.

Location:
trunk/src/wp-admin
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/css/forms.css

    r42967 r42978  
    10771077}
    10781078
     1079/*------------------------------------------------------------------------------
     1080   Privacy Policy settings screen
     1081------------------------------------------------------------------------------*/
     1082.tools-privacy-policy-page form {
     1083        margin-bottom: 1.3em;
     1084}
     1085
     1086.tools-privacy-policy-page input.button,
     1087.tools-privacy-policy-page select {
     1088        margin-left: 6px;
     1089}
     1090
     1091.tools-privacy-edit {
     1092        margin: 2.3em 0;
     1093}
     1094
     1095.tools-privacy-policy-page span {
     1096        line-height: 2em;
     1097}
     1098
     1099.privacy_requests .column-email {
     1100        width: 40%;
     1101}
     1102
     1103.privacy_requests .column-type {
     1104        text-align: center;
     1105}
     1106
     1107.privacy_requests thead td:first-child,
     1108.privacy_requests tfoot td:first-child {
     1109        border-left: 4px solid #fff;
     1110}
     1111
     1112.privacy_requests tbody th {
     1113        border-left: 4px solid #fff;
     1114        background: #fff;
     1115        box-shadow: inset 0 -1px 0 rgba(0,0,0,0.1);
     1116}
     1117
     1118.privacy_requests tbody td {
     1119        background: #fff;
     1120        box-shadow: inset 0 -1px 0 rgba(0,0,0,0.1);
     1121}
     1122
     1123.privacy_requests .status-request-confirmed th,
     1124.privacy_requests .status-request-confirmed td {
     1125        background-color: #f7fcfe;
     1126        border-left-color: #00a0d2;
     1127}
     1128
     1129.privacy_requests .status-request-failed th,
     1130.privacy_requests .status-request-failed td {
     1131        background-color: #fef7f1;
     1132        border-left-color: #d64d21;
     1133}
     1134
     1135.status-label {
     1136        font-weight: bold;
     1137}
     1138
     1139.status-label.status-request-pending {
     1140        font-weight: normal;
     1141        font-style: italic;
     1142        color: #6c7781;
     1143}
     1144
     1145.status-label.status-request-failed {
     1146        color: #aa0000;
     1147        font-weight: bold;
     1148}
     1149
     1150.wp-privacy-request-form {
     1151        clear: both;
     1152}
     1153
     1154.wp-privacy-request-form-field {
     1155        margin: 1.5em 0;
     1156}
     1157
     1158.wp-privacy-request-form label {
     1159        font-weight: bold;
     1160        line-height: 1.5;
     1161        padding-bottom: .5em;
     1162        display: block;
     1163}
     1164
     1165.wp-privacy-request-form input {
     1166        line-height: 1.5;
     1167        margin: 0;
     1168}
     1169
     1170.email-personal-data::before {
     1171        display: inline-block;
     1172        font: normal 20px/1 dashicons;
     1173        margin: 3px 5px 0 -2px;
     1174        speak: none;
     1175        -webkit-font-smoothing: antialiased;
     1176        -moz-osx-font-smoothing: grayscale;
     1177        vertical-align: top;
     1178}
     1179
     1180.email-personal-data--sending::before {
     1181        color: #f56e28;
     1182        content: "\f463";
     1183        -webkit-animation: rotation 2s infinite linear;
     1184        animation: rotation 2s infinite linear;
     1185}
     1186
     1187.email-personal-data--sent::before {
     1188        color: #79ba49;
     1189        content: "\f147";
     1190}
     1191
    10791192
    10801193/* =Media Queries
     
    14051518}
    14061519
    1407 
    1408 /* Privacy */
    1409 
    1410 .privacy_requests .column-email {
    1411         width: 40%;
    1412 }
    1413 .privacy_requests .column-type {
    1414         text-align: center;
    1415 }
    1416 .privacy_requests thead td:first-child,
    1417 .privacy_requests tfoot td:first-child {
    1418         border-left: 4px solid #fff;
    1419 }
    1420 .privacy_requests tbody th {
    1421         border-left: 4px solid #fff;
    1422         background: #fff;
    1423         box-shadow: inset 0 -1px 0 rgba(0,0,0,0.1);
    1424 }
    1425 .privacy_requests tbody td {
    1426         background: #fff;
    1427         box-shadow: inset 0 -1px 0 rgba(0,0,0,0.1);
    1428 }
    1429 .privacy_requests .status-request-confirmed th,
    1430 .privacy_requests .status-request-confirmed td {
    1431         background-color: #f7fcfe;
    1432         border-left-color: #00a0d2;
    1433 }
    1434 .privacy_requests .status-request-failed th,
    1435 .privacy_requests .status-request-failed td {
    1436         background-color: #fef7f1;
    1437         border-left-color: #d64d21;
    1438 }
    1439 .status-label {
    1440         font-weight: bold;
    1441 }
    1442 .status-label.status-request-pending {
    1443         font-weight: normal;
    1444         font-style: italic;
    1445         color: #6c7781;
    1446 }
    1447 .status-label.status-request-failed {
    1448         color: #aa0000;
    1449         font-weight: bold;
    1450 }
    1451 .wp-privacy-request-form {
    1452         clear: both;
    1453 }
    1454 .wp-privacy-request-form-field {
    1455         margin: 1.5em 0;
    1456 }
    1457 .wp-privacy-request-form label {
    1458         font-weight: bold;
    1459         line-height: 1.5;
    1460         padding-bottom: .5em;
    1461         display: block;
    1462 }
    1463 .wp-privacy-request-form input {
    1464         line-height: 1.5;
    1465         margin: 0;
    1466 }
    1467 .email-personal-data::before {
    1468         display: inline-block;
    1469         font: normal 20px/1 dashicons;
    1470         margin: 3px 5px 0 -2px;
    1471         speak: none;
    1472         -webkit-font-smoothing: antialiased;
    1473         -moz-osx-font-smoothing: grayscale;
    1474         vertical-align: top;
    1475 }
    1476 .email-personal-data--sending::before {
    1477         color: #f56e28;
    1478         content: "\f463";
    1479         -webkit-animation: rotation 2s infinite linear;
    1480         animation: rotation 2s infinite linear;
    1481 }
    1482 .email-personal-data--sent::before {
    1483         color: #79ba49;
    1484         content: "\f147";
    1485 }
    14861520@-webkit-keyframes rotation {
    14871521        0% {
     
    14941528        }
    14951529}
     1530
    14961531@keyframes rotation {
    14971532        0% {
  • trunk/src/wp-admin/privacy.php

    r42823 r42978  
    2929                        'page_for_privacy_policy',
    3030                        'page_for_privacy_policy',
    31                         __( 'Privacy policy page updated successfully.' ),
     31                        sprintf(
     32                                // translators: URL to Customizer -> Menus
     33                                __( 'Privacy policy page updated successfully. Remember to <a href="%s">update your menus</a>!' ),
     34                                'customize.php?autofocus[panel]=nav_menus'
     35                        ),
    3236                        'updated'
    3337                );
     
    5155                } else {
    5256                        update_option( 'wp_page_for_privacy_policy', $privacy_policy_page_id );
     57
    5358                        add_settings_error(
    5459                                'page_for_privacy_policy',
    5560                                'page_for_privacy_policy',
    56                                 __( 'Privacy policy page created successfully.' ),
     61                                sprintf(
     62                                        // translators: URL to edit Privacy Policy page
     63                                        __( 'Your Privacy Policy page created successfully. You&#8217;ll want to <a href="%s">review and edit your policy</a> next.' ),
     64                                        'post.php?post=' . $privacy_policy_page_id . '&action=edit'
     65                                ),
    5766                                'updated'
    5867                        );
     
    6372// If a privacy policy page ID is available, make sure the page actually exists. If not, display an error.
    6473$privacy_policy_page_exists = false;
    65 $privacy_policy_page_id = (int) get_option( 'wp_page_for_privacy_policy' );
     74$privacy_policy_page_id     = (int) get_option( 'wp_page_for_privacy_policy' );
    6675
    6776if ( ! empty( $privacy_policy_page_id ) ) {
    68                 $privacy_policy_page = get_post( $privacy_policy_page_id );
    69                 if ( ! $privacy_policy_page instanceof WP_Post ) {
     77
     78        $privacy_policy_page = get_post( $privacy_policy_page_id );
     79
     80        if ( ! $privacy_policy_page instanceof WP_Post ) {
     81                add_settings_error(
     82                        'page_for_privacy_policy',
     83                        'page_for_privacy_policy',
     84                        __( 'The currently selected privacy policy page does not exist. Please create or select new page.' ),
     85                        'error'
     86                );
     87        } else {
     88                if ( 'trash' === $privacy_policy_page->post_status ) {
    7089                        add_settings_error(
    7190                                'page_for_privacy_policy',
    7291                                'page_for_privacy_policy',
    73                                 __( 'The currently selected privacy policy page does not exist. Please create or select new page.' ),
     92                                sprintf(
     93                                        // translators: URL to Pages Trash.
     94                                        __( 'The currently selected privacy policy page is in the trash. Please create or select new privacy policy page or <a href="%s">restore the current page</a>.' ),
     95                                        'edit.php?post_status=trash&post_type=page'
     96                                ),
    7497                                'error'
    7598                        );
    7699                } else {
    77                         if ( 'trash' === $privacy_policy_page->post_status ) {
    78                                 add_settings_error(
    79                                         'page_for_privacy_policy',
    80                                         'page_for_privacy_policy',
    81                                         sprintf(
    82                                                 __( 'The currently selected privacy policy page is in the trash. Please create or select new privacy policy page or <a href="%s">restore the current page</a>.' ),
    83                                                 'edit.php?post_status=trash&post_type=page'
    84                                         ),
    85                                         'error'
    86                                 );
    87                         } else {
    88                                 $privacy_policy_page_exists = true;
    89                         }
     100                        $privacy_policy_page_exists = true;
    90101                }
     102        }
    91103}
    92104
     
    94106        'id'      => 'privacy',
    95107        'title'   => __( 'Privacy' ),
    96         'content' => '<p>' . __( 'This page provides tools with which you can manage your user\'s personal data and site\'s privacy policy.' ) . '</p>',
     108        'content' => '<p>' . __( 'This page provides tools with which you can manage your user&#8217;s personal data and site&#8217;s privacy policy.' ) . '</p>',
    97109) );
    98110
     
    108120        <h1><?php _e( 'Privacy Tools' ); ?></h1>
    109121        <?php settings_errors(); ?>
    110 
    111         <h2><?php _e( 'Privacy policy page' ); ?></h2>
    112 
     122        <h2><?php _e( 'Privacy Policy page' ); ?></h2>
     123        <p>
     124                <?php _e( 'The first step towards privacy laws compliance is to have a comprehensive Privacy Policy.' ); ?>
     125                <?php _e( 'If you already have a Privacy Policy page, please select it below. If not, create one.' ); ?>
     126                <?php _e( 'The new policy will include the suggested privacy text.' ); ?>
     127        </p>
     128        <p>
     129                <?php _e( 'After your Privacy Policy page is set, we suggest that you edit it.' ); ?>
     130                <?php _e( 'On the edit page screen you will find additional privacy information added by your plugins.' ); ?>
     131                <?php _e( 'We would also suggest reviewing your privacy policy from time to time, after a WordPress or a plugin update.' ); ?>
     132                <?php _e( 'There may be changes or new suggested information for you to consider adding to your policy.' ); ?>
     133        </p>
    113134        <?php
    114135        if ( $privacy_policy_page_exists ) {
    115136                $edit_href = add_query_arg(
    116137                        array(
    117                                 'post'  => $privacy_policy_page_id,
     138                                'post'   => $privacy_policy_page_id,
    118139                                'action' => 'edit',
    119140                        ),
    120141                        admin_url( 'post.php' )
    121142                );
     143
    122144                $view_href = get_permalink( $privacy_policy_page_id );
    123 
    124145                ?>
    125                 <p><strong>
     146                <p class="tools-privacy-edit"><strong>
    126147                        <?php
    127148                        printf(
    128                                 __( '<a href="%1$s">Edit</a> or <a href="%2$s">view</a> your privacy policy.' ),
     149                                // translators: %1$s URL to Edit Page, %2$s URL to View Page
     150                                __( '<a href="%1$s">Edit</a> or <a href="%2$s">view</a> your privacy policy page content.' ),
    129151                                $edit_href,
    130152                                $view_href
     
    135157        }
    136158        ?>
    137 
    138         <table class="form-table">
     159        <hr>
     160        <table class="form-table tools-privacy-policy-page">
    139161                <tr>
    140162                        <th scope="row">
    141                                 <label for="page_for_privacy_policy">
    142                                         <?php
    143 
    144                                         if ( $privacy_policy_page_exists ) {
    145                                                 _e( 'Select another page for your privacy policy' );
    146                                         } else {
    147                                                 _e( 'Select an existing privacy policy page' );
    148                                         }
    149 
    150                                         ?>
    151                                 </label>
     163                                <?php
     164                                if ( $privacy_policy_page_exists ) {
     165                                        _e( 'Change your Privacy Policy page' );
     166                                } else {
     167                                        _e( 'Select a Privacy Policy page' );
     168                                }
     169                                ?>
    152170                        </th>
    153                         <td id="front-static-pages">
     171                        <td>
    154172                                <form method="post" action="">
     173                                        <label for="page_for_privacy_policy">
     174                                                <?php _e( 'Either select an existing page:' ); ?>
     175                                        </label>
    155176                                        <input type="hidden" name="action" value="set-privacy-page" />
    156177                                        <?php
    157 
    158178                                        wp_dropdown_pages(
    159179                                                array(
     
    167187
    168188                                        wp_nonce_field( 'set-privacy-page' );
    169                                         submit_button( __( 'Set Page' ), 'primary', 'submit', true, array( 'id' => 'set-page' ) );
    170 
     189
     190                                        submit_button( __( 'Use This Page' ), 'primary', 'submit', false, array( 'id' => 'set-page' ) );
     191                                        ?>
     192                                </form>
     193
     194                                <form method="post" action="">
     195                                        <input type="hidden" name="action" value="create-privacy-page" />
     196                                        <span>
     197                                                <?php _e( 'Or create a new page: ' ); ?>
     198                                        </span>
     199                                        <?php
     200                                        wp_nonce_field( 'create-privacy-page' );
     201       
     202                                        submit_button( __( 'Create New Page' ), 'primary', 'submit', false, array( 'id' => 'create-page' ) );
    171203                                        ?>
    172204                                </form>
    173205                        </td>
    174206                </tr>
    175                 <?php
    176 
    177                 if ( ! $privacy_policy_page_exists ) {
    178                         ?>
    179                         <tr>
    180                                 <th scope="row"><?php _e( 'Create new page for your privacy policy' ); ?></th>
    181                                 <td>
    182                                         <form method="post" action="">
    183                                                 <input type="hidden" name="action" value="create-privacy-page" />
    184                                                 <?php
    185 
    186                                                 wp_nonce_field( 'create-privacy-page' );
    187                                                 submit_button( __( 'Create Page' ), 'primary', 'submit', true, array( 'id' => 'create-page' ) );
    188 
    189                                                 ?>
    190                                         </form>
    191                                 </td>
    192                         </tr>
    193                         <?php
    194                 }
    195 
    196                 ?>
    197207        </table>
    198208</div>
    199 
    200209<?php
    201210
Note: See TracChangeset for help on using the changeset viewer.