Changeset 42978 for trunk/src/wp-admin/privacy.php
- Timestamp:
- 04/13/2018 05:55:25 PM (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-admin/privacy.php
r42823 r42978 29 29 'page_for_privacy_policy', 30 30 '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 ), 32 36 'updated' 33 37 ); … … 51 55 } else { 52 56 update_option( 'wp_page_for_privacy_policy', $privacy_policy_page_id ); 57 53 58 add_settings_error( 54 59 'page_for_privacy_policy', 55 60 '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’ll want to <a href="%s">review and edit your policy</a> next.' ), 64 'post.php?post=' . $privacy_policy_page_id . '&action=edit' 65 ), 57 66 'updated' 58 67 ); … … 63 72 // If a privacy policy page ID is available, make sure the page actually exists. If not, display an error. 64 73 $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' ); 66 75 67 76 if ( ! 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 ) { 70 89 add_settings_error( 71 90 'page_for_privacy_policy', 72 91 '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 ), 74 97 'error' 75 98 ); 76 99 } 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; 90 101 } 102 } 91 103 } 92 104 … … 94 106 'id' => 'privacy', 95 107 '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’s personal data and site’s privacy policy.' ) . '</p>', 97 109 ) ); 98 110 … … 108 120 <h1><?php _e( 'Privacy Tools' ); ?></h1> 109 121 <?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> 113 134 <?php 114 135 if ( $privacy_policy_page_exists ) { 115 136 $edit_href = add_query_arg( 116 137 array( 117 'post' => $privacy_policy_page_id,138 'post' => $privacy_policy_page_id, 118 139 'action' => 'edit', 119 140 ), 120 141 admin_url( 'post.php' ) 121 142 ); 143 122 144 $view_href = get_permalink( $privacy_policy_page_id ); 123 124 145 ?> 125 <p ><strong>146 <p class="tools-privacy-edit"><strong> 126 147 <?php 127 148 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.' ), 129 151 $edit_href, 130 152 $view_href … … 135 157 } 136 158 ?> 137 138 <table class="form-table ">159 <hr> 160 <table class="form-table tools-privacy-policy-page"> 139 161 <tr> 140 162 <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 ?> 152 170 </th> 153 <td id="front-static-pages">171 <td> 154 172 <form method="post" action=""> 173 <label for="page_for_privacy_policy"> 174 <?php _e( 'Either select an existing page:' ); ?> 175 </label> 155 176 <input type="hidden" name="action" value="set-privacy-page" /> 156 177 <?php 157 158 178 wp_dropdown_pages( 159 179 array( … … 167 187 168 188 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' ) ); 171 203 ?> 172 204 </form> 173 205 </td> 174 206 </tr> 175 <?php176 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 <?php185 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 <?php194 }195 196 ?>197 207 </table> 198 208 </div> 199 200 209 <?php 201 210
Note: See TracChangeset
for help on using the changeset viewer.