WordPress.org

Make WordPress Core


Ignore:
Timestamp:
05/09/2018 08:50:54 PM (2 years ago)
Author:
azaozz
Message:

Privacy: fixes for the privacy policy guide and suggested content:

  • Separate the guide text form the suggested policy text.
  • Add table of content for easier navigation.
  • Move the content to tools.php (prevents the settings menu of being open).
  • Add a link to the guide from the Privacy settings screen.

Props melchoyce, azaozz.
See #43980.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/privacy.php

    r43201 r43203  
    1414}
    1515
    16 if ( ! class_exists( 'WP_Privacy_Policy_Content' ) ) {
    17     require_once( ABSPATH . 'wp-admin/includes/misc.php' );
    18 }
    19 
    20 // "Borrow" xfn.js for now so we don't have to create new files.
    21 wp_enqueue_script( 'xfn' );
    22 
    2316$action = isset( $_POST['action'] ) ? $_POST['action'] : '';
    2417
     
    4134        );
    4235    } elseif ( 'create-privacy-page' === $action ) {
     36
     37        if ( ! class_exists( 'WP_Privacy_Policy_Content' ) ) {
     38            require_once( ABSPATH . 'wp-admin/includes/misc.php' );
     39        }
    4340
    4441        $privacy_policy_page_content = WP_Privacy_Policy_Content::get_default_content();
     
    106103?>
    107104<div class="wrap">
    108 <?php
    109 
    110 if ( isset( $_GET['wp-suggested-policy-content'] ) ) {
    111 
    112     ?>
    113     <h1><?php _e( 'Privacy Policy Guide' ); ?></h1>
    114     <div class="wp-suggested-policy-content">
    115         <?php WP_Privacy_Policy_Content::privacy_policy_guide(); ?>
    116     </div>
    117     <?php
    118 
    119 } else {
    120 
    121 ?>
    122105    <h1><?php _e( 'Privacy Settings' ); ?></h1>
    123106    <h2><?php _e( 'Privacy Policy page' ); ?></h2>
     
    135118    </p>
    136119    <?php
     120
    137121    if ( $privacy_policy_page_exists ) {
    138122        $edit_href = add_query_arg(
     
    145129
    146130        $view_href = get_permalink( $privacy_policy_page_id );
     131
    147132        ?>
    148133        <p class="tools-privacy-edit"><strong>
    149134            <?php
    150             printf(
    151                 /* translators: 1: URL to edit page, 2: URL to view page */
    152                 __( '<a href="%1$s">Edit</a> or <a href="%2$s">view</a> your privacy policy page content.' ),
    153                 $edit_href,
    154                 $view_href
    155             );
     135
     136            /* translators: 1: URL to edit page, 2: URL to view page */
     137            printf( __( '<a href="%1$s">Edit</a> or <a href="%2$s">view</a> your privacy policy page content.' ), $edit_href, $view_href );
     138
    156139            ?>
    157140        </strong></p>
     141        <p>
     142            <?php
     143
     144            printf(
     145                __( 'Need help putting together your new Privacy Policy page? %s for recommendations on what content to include, along with policies suggested by your plugins and theme.' ),
     146                '<a href="' . admin_url( 'tools.php?wp-privacy-policy-guide' ) . '">' . __( 'Check out our guide' ) . '</a>'
     147            );
     148
     149            ?>
     150        </p>
    158151        <?php
    159152    }
     
    210203</div>
    211204<?php
    212 } // End if/else isset( $_GET['wp-suggested-policy-content'] ).
    213205
    214206include( ABSPATH . 'wp-admin/admin-footer.php' );
Note: See TracChangeset for help on using the changeset viewer.