Ticket #43435: 43435.6.diff
File 43435.6.diff, 7.3 KB (added by , 7 years ago) |
---|
-
src/wp-admin/css/forms.css
1407 1407 1408 1408 /* Privacy */ 1409 1409 1410 .tools-privacy-policy-page span { 1411 vertical-align: middle; 1412 } 1410 1413 .privacy_requests .column-email { 1411 1414 width: 40%; 1412 1415 } -
src/wp-admin/privacy.php
28 28 add_settings_error( 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 ); 34 38 } elseif ( 'create-privacy-page' === $action ) { … … 50 54 ); 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 ); 59 68 } … … 62 71 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 93 105 get_current_screen()->add_help_tab( array( 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 99 111 get_current_screen()->set_help_sidebar( … … 107 119 <div class="wrap"> 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 Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer lacinia, velit ut tempus iaculis, nibh dui luctus nisi, quis faucibus nisi risus sed mi. Mauris lectus libero, iaculis sed fringilla sed, varius ut odio. Cras tempus elit dui, at aliquet velit porttitor nec. Sed vestibulum, est vitae egestas hendrerit, lorem odio fermentum ex, et congue odio nisl et nunc. Pellentesque non libero nunc. 125 </p> 113 126 <?php 114 127 if ( $privacy_policy_page_exists ) { 115 128 $edit_href = add_query_arg( 116 129 array( 117 'post' => $privacy_policy_page_id,130 'post' => $privacy_policy_page_id, 118 131 'action' => 'edit', 119 132 ), 120 133 admin_url( 'post.php' ) 121 134 ); 135 122 136 $view_href = get_permalink( $privacy_policy_page_id ); 123 124 137 ?> 125 138 <p><strong> 126 139 <?php 127 140 printf( 128 __( '<a href="%1$s">Edit</a> or <a href="%2$s">view</a> your privacy policy.' ), 141 // translators: %1$s URL to Edit Page, %2$s URL to View Page 142 __( '<a href="%1$s">Edit</a> or <a href="%2$s">view</a> your privacy policy page content.' ), 129 143 $edit_href, 130 144 $view_href 131 145 ); … … 134 148 <?php 135 149 } 136 150 ?> 137 138 <table class="form-table ">151 <hr> 152 <table class="form-table tools-privacy-policy-page"> 139 153 <tr> 140 154 <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> 155 <?php 156 if ( $privacy_policy_page_exists ) { 157 _e( 'Change your Privacy Policy page' ); 158 } else { 159 _e( 'Select a Privacy Policy page' ); 160 } 161 ?> 152 162 </th> 153 <td id="front-static-pages">163 <td> 154 164 <form method="post" action=""> 165 <label for="page_for_privacy_policy"> 166 Either select an existing page: 167 </label> 155 168 <input type="hidden" name="action" value="set-privacy-page" /> 156 169 <?php 157 158 170 wp_dropdown_pages( 159 171 array( 160 172 'name' => 'page_for_privacy_policy', … … 166 178 ); 167 179 168 180 wp_nonce_field( 'set-privacy-page' ); 169 submit_button( __( 'Set Page' ), 'primary', 'submit', true, array( 'id' => 'set-page' ) );170 181 182 submit_button( __( 'Set Page' ), 'primary', 'submit', false, array( 'id' => 'set-page' ) ); 171 183 ?> 172 184 </form> 173 185 </td> 174 186 </tr> 175 <?php 187 <tr> 188 <th></th> 189 <td> 190 <form method="post" action=""> 191 <input type="hidden" name="action" value="create-privacy-page" /> 192 <span> 193 <?php _e( 'Or create a new page: ' ); ?> 194 </span> 195 <?php 196 wp_nonce_field( 'create-privacy-page' ); 176 197 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 ?> 198 submit_button( __( 'Create Page' ), 'primary', 'submit', false, array( 'id' => 'create-page' ) ); 199 ?> 200 </form> 201 </td> 197 202 </table> 198 203 </div> 199 200 204 <?php 201 205 202 206 include( ABSPATH . 'wp-admin/admin-footer.php' );