Changeset 45451
- Timestamp:
- 05/26/2019 10:56:18 PM (5 years ago)
- Location:
- trunk/src/wp-admin
- Files:
-
- 3 edited
- 1 copied
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-admin/about.php
r45338 r45451 46 46 <a href="credits.php" class="nav-tab"><?php _e( 'Credits' ); ?></a> 47 47 <a href="freedoms.php" class="nav-tab"><?php _e( 'Freedoms' ); ?></a> 48 <a href=" freedoms.php?privacy-notice" class="nav-tab"><?php _e( 'Privacy' ); ?></a>48 <a href="privacy.php" class="nav-tab"><?php _e( 'Privacy' ); ?></a> 49 49 </nav> 50 50 -
trunk/src/wp-admin/credits.php
r45338 r45451 47 47 <a href="credits.php" class="nav-tab nav-tab-active" aria-current="page"><?php _e( 'Credits' ); ?></a> 48 48 <a href="freedoms.php" class="nav-tab"><?php _e( 'Freedoms' ); ?></a> 49 <a href=" freedoms.php?privacy-notice" class="nav-tab"><?php _e( 'Privacy' ); ?></a>49 <a href="privacy.php" class="nav-tab"><?php _e( 'Privacy' ); ?></a> 50 50 </nav> 51 51 -
trunk/src/wp-admin/freedoms.php
r45338 r45451 16 16 include( ABSPATH . 'wp-admin/admin-header.php' ); 17 17 18 $is_privacy_notice = isset( $_GET['privacy-notice'] ); 19 20 if ( $is_privacy_notice ) { 21 $freedoms_class = ''; 22 $privacy_class = ' nav-tab-active'; 23 $freedoms_aria_current = ''; 24 $privacy_aria_current = ' aria-current="page"'; 25 } else { 26 $freedoms_class = ' nav-tab-active'; 27 $privacy_class = ''; 28 $freedoms_aria_current = ' aria-current="page"'; 29 $privacy_aria_current = ''; 18 // This file was used to also display the Privacy tab on the About screen from 4.9.6 until 5.3.0. 19 if ( isset( $_GET['privacy-notice'] ) ) { 20 wp_redirect( admi_url( 'privacy.php' ), 301 ); 21 exit; 30 22 } 31 23 … … 60 52 <a href="about.php" class="nav-tab"><?php _e( 'What’s New' ); ?></a> 61 53 <a href="credits.php" class="nav-tab"><?php _e( 'Credits' ); ?></a> 62 <a href="freedoms.php" class="nav-tab <?php echo $freedoms_class; ?>"<?php echo $freedoms_aria_current; ?>><?php _e( 'Freedoms' ); ?></a>63 <a href=" freedoms.php?privacy-notice" class="nav-tab<?php echo $privacy_class; ?>"<?php echo $privacy_aria_current; ?>><?php _e( 'Privacy' ); ?></a>54 <a href="freedoms.php" class="nav-tab nav-tab-active" aria-current="page"><?php _e( 'Freedoms' ); ?></a> 55 <a href="privacy.php" class="nav-tab"><?php _e( 'Privacy' ); ?></a> 64 56 </nav> 65 57 66 <?php if ( $is_privacy_notice ) : ?>67 68 <div class="about-wrap-content">69 <p class="about-description"><?php _e( 'From time to time, your WordPress site may send data to WordPress.org — including, but not limited to — the version of WordPress you are using, and a list of installed plugins and themes.' ); ?></p>70 71 <p>72 <?php73 /* translators: %s: https://wordpress.org/about/stats/ */74 printf( __( 'This data is used to provide general enhancements to WordPress, which includes helping to protect your site by finding and automatically installing new updates. It is also used to calculate statistics, such as those shown on the <a href="%s">WordPress.org stats page</a>.' ), 'https://wordpress.org/about/stats/' );75 ?>76 </p>77 78 <p>79 <?php80 /* translators: %s: https://wordpress.org/about/privacy/ */81 printf( __( 'We take privacy and transparency very seriously. To learn more about what data we collect, and how we use it, please visit <a href="%s">WordPress.org/about/privacy</a>.' ), 'https://wordpress.org/about/privacy/' );82 ?>83 </p>84 </div>85 86 <?php else : ?>87 58 <div class="about-wrap-content"> 88 59 <div class="feature-section has-1-columns"> … … 140 111 </div> 141 112 142 <?php endif; ?>143 113 </div> 144 114 <?php include( ABSPATH . 'wp-admin/admin-footer.php' ); ?> -
trunk/src/wp-admin/privacy.php
-
Property
svn:mergeinfo
set to
(toggle deleted branches)
/branches/4.9/src/wp-admin/privacy.php merged eligible /branches/5.0/src/wp-admin/privacy.php merged eligible /branches/3.1/src/wp-admin/privacy.php 18031 /branches/3.3/src/wp-admin/privacy.php 20543 /branches/3.4/src/wp-admin/privacy.php 21757
r45447 r45451 1 1 <?php 2 2 /** 3 * Privacy Settings Screen.3 * Privacy administration panel. 4 4 * 5 5 * @package WordPress … … 10 10 require_once( dirname( __FILE__ ) . '/admin.php' ); 11 11 12 if ( ! current_user_can( 'manage_privacy_options' ) ) { 13 wp_die( __( 'Sorry, you are not allowed to manage privacy on this site.' ) ); 14 } 12 $title = __( 'Privacy' ); 15 13 16 $action = isset( $_POST['action'] ) ? $_POST['action'] : '';14 list( $display_version ) = explode( '-', get_bloginfo( 'version' ) ); 17 15 18 if ( ! empty( $action ) ) { 19 check_admin_referer( $action ); 16 include( ABSPATH . 'wp-admin/admin-header.php' ); 17 ?> 18 <div class="wrap about-wrap full-width-layout"> 20 19 21 if ( 'set-privacy-page' === $action ) { 22 $privacy_policy_page_id = isset( $_POST['page_for_privacy_policy'] ) ? (int) $_POST['page_for_privacy_policy'] : 0; 23 update_option( 'wp_page_for_privacy_policy', $privacy_policy_page_id ); 20 <h1> 21 <?php 22 /* translators: %s: The current WordPress version number */ 23 printf( __( 'Welcome to WordPress %s' ), $display_version ); 24 ?> 25 </h1> 24 26 25 $privacy_page_updated_message = __( 'Privacy Policy page updated successfully.' ); 27 <p class="about-text"> 28 <?php 29 printf( 30 /* translators: %s: The current WordPress version number */ 31 __( 'Congratulations on updating to WordPress %s! This update makes it easier than ever to fix your site if something goes wrong.' ), 32 $display_version 33 ); 34 ?> 35 </p> 26 36 27 if ( $privacy_policy_page_id ) { 28 /* 29 * Don't always link to the menu customizer: 30 * 31 * - Unpublished pages can't be selected by default. 32 * - `WP_Customize_Nav_Menus::__construct()` checks the user's capabilities. 33 * - Themes might not "officially" support menus. 34 */ 35 if ( 36 'publish' === get_post_status( $privacy_policy_page_id ) 37 && current_user_can( 'edit_theme_options' ) 38 && current_theme_supports( 'menus' ) 39 ) { 40 $privacy_page_updated_message = sprintf( 41 /* translators: %s: URL to Customizer -> Menus */ 42 __( 'Privacy Policy page setting updated successfully. Remember to <a href="%s">update your menus</a>!' ), 43 esc_url( add_query_arg( 'autofocus[panel]', 'nav_menus', admin_url( 'customize.php' ) ) ) 44 ); 45 } 46 } 37 <div class="wp-badge"> 38 <?php 39 /* translators: %s: The current WordPress version number */ 40 printf( __( 'Version %s' ), $display_version ); 41 ?> 42 </div> 47 43 48 add_settings_error( 49 'page_for_privacy_policy', 50 'page_for_privacy_policy', 51 $privacy_page_updated_message, 52 'updated' 53 ); 54 } elseif ( 'create-privacy-page' === $action ) { 44 <nav class="nav-tab-wrapper wp-clearfix" aria-label="<?php esc_attr_e( 'Secondary menu' ); ?>"> 45 <a href="about.php" class="nav-tab"><?php _e( 'What’s New' ); ?></a> 46 <a href="credits.php" class="nav-tab"><?php _e( 'Credits' ); ?></a> 47 <a href="freedoms.php" class="nav-tab"><?php _e( 'Freedoms' ); ?></a> 48 <a href="privacy.php" class="nav-tab nav-tab-active" aria-current="page"><?php _e( 'Privacy' ); ?></a> 49 </nav> 55 50 56 if ( ! class_exists( 'WP_Privacy_Policy_Content' ) ) { 57 require_once( ABSPATH . 'wp-admin/includes/misc.php' ); 58 } 51 <div class="about-wrap-content"> 52 <p class="about-description"><?php _e( 'From time to time, your WordPress site may send data to WordPress.org — including, but not limited to — the version of WordPress you are using, and a list of installed plugins and themes.' ); ?></p> 59 53 60 $privacy_policy_page_content = WP_Privacy_Policy_Content::get_default_content();61 $privacy_policy_page_id = wp_insert_post(62 array(63 'post_title' => __( 'Privacy Policy' ),64 'post_status' => 'draft',65 'post_type' => 'page',66 'post_content' => $privacy_policy_page_content,67 ),68 true69 );70 71 if ( is_wp_error( $privacy_policy_page_id ) ) {72 add_settings_error(73 'page_for_privacy_policy',74 'page_for_privacy_policy',75 __( 'Unable to create a Privacy Policy page.' ),76 'error'77 );78 } else {79 update_option( 'wp_page_for_privacy_policy', $privacy_policy_page_id );80 81 wp_redirect( admin_url( 'post.php?post=' . $privacy_policy_page_id . '&action=edit' ) );82 exit;83 }84 }85 }86 87 // If a Privacy Policy page ID is available, make sure the page actually exists. If not, display an error.88 $privacy_policy_page_exists = false;89 $privacy_policy_page_id = (int) get_option( 'wp_page_for_privacy_policy' );90 91 if ( ! empty( $privacy_policy_page_id ) ) {92 93 $privacy_policy_page = get_post( $privacy_policy_page_id );94 95 if ( ! $privacy_policy_page instanceof WP_Post ) {96 add_settings_error(97 'page_for_privacy_policy',98 'page_for_privacy_policy',99 __( 'The currently selected Privacy Policy page does not exist. Please create or select a new page.' ),100 'error'101 );102 } else {103 if ( 'trash' === $privacy_policy_page->post_status ) {104 add_settings_error(105 'page_for_privacy_policy',106 'page_for_privacy_policy',107 sprintf(108 /* translators: URL to Pages Trash */109 __( 'The currently selected Privacy Policy page is in the trash. Please create or select a new Privacy Policy page or <a href="%s">restore the current page</a>.' ),110 'edit.php?post_status=trash&post_type=page'111 ),112 'error'113 );114 } else {115 $privacy_policy_page_exists = true;116 }117 }118 }119 120 $title = __( 'Privacy Settings' );121 $parent_file = 'options-general.php';122 123 require_once( ABSPATH . 'wp-admin/admin-header.php' );124 125 ?>126 <div class="wrap">127 <h1><?php echo $title; ?></h1>128 <h2><?php _e( 'Privacy Policy Page' ); ?></h2>129 <p>130 <?php _e( 'As a website owner, you may need to follow national or international privacy laws. For example, you may need to create and display a Privacy Policy.' ); ?>131 <?php _e( 'If you already have a Privacy Policy page, please select it below. If not, please create one.' ); ?>132 </p>133 <p>134 <?php _e( 'The new page will include help and suggestions for your Privacy Policy.' ); ?>135 <?php _e( 'However, it is your responsibility to use those resources correctly, to provide the information that your Privacy Policy requires, and to keep that information current and accurate.' ); ?>136 </p>137 <p>138 <?php _e( 'After your Privacy Policy page is set, we suggest that you edit it.' ); ?>139 <?php _e( 'We would also suggest reviewing your Privacy Policy from time to time, especially after installing or updating any themes or plugins. There may be changes or new suggested information for you to consider adding to your policy.' ); ?>140 </p>141 <?php142 143 if ( $privacy_policy_page_exists ) {144 $edit_href = add_query_arg(145 array(146 'post' => $privacy_policy_page_id,147 'action' => 'edit',148 ),149 admin_url( 'post.php' )150 );151 152 $view_href = get_permalink( $privacy_policy_page_id );153 154 ?>155 <p class="tools-privacy-edit"><strong>156 <?php157 158 if ( 'publish' === get_post_status( $privacy_policy_page_id ) ) {159 printf(160 /* translators: 1: URL to edit Privacy Policy page, 2: URL to view Privacy Policy page */161 __( '<a href="%1$s">Edit</a> or <a href="%2$s">view</a> your Privacy Policy page content.' ),162 esc_url( $edit_href ),163 esc_url( $view_href )164 );165 } else {166 printf(167 /* translators: 1: URL to edit Privacy Policy page, 2: URL to preview Privacy Policy page */168 __( '<a href="%1$s">Edit</a> or <a href="%2$s">preview</a> your Privacy Policy page content.' ),169 esc_url( $edit_href ),170 esc_url( $view_href )171 );172 }173 174 ?>175 </strong></p>176 <?php177 }178 ?>179 54 <p> 180 55 <?php 181 182 printf( 183 /* translators: 1: Privacy Policy guide URL, 2: additional link attributes, 3: accessibility text */ 184 __( 'Need help putting together your new Privacy Policy page? <a href="%1$s" %2$s>Check out our guide%3$s</a> for recommendations on what content to include, along with policies suggested by your plugins and theme.' ), 185 esc_url( admin_url( 'tools.php?wp-privacy-policy-guide=1' ) ), 186 '', 187 '' 188 ); 189 56 /* translators: %s: https://wordpress.org/about/stats/ */ 57 printf( __( 'This data is used to provide general enhancements to WordPress, which includes helping to protect your site by finding and automatically installing new updates. It is also used to calculate statistics, such as those shown on the <a href="%s">WordPress.org stats page</a>.' ), 'https://wordpress.org/about/stats/' ); 190 58 ?> 191 59 </p> 192 60 193 <hr> 194 <table class="form-table tools-privacy-policy-page" role="presentation"> 195 <tr> 196 <th scope="row"><label for="page_for_privacy_policy"> 197 <?php 198 if ( $privacy_policy_page_exists ) { 199 _e( 'Change your Privacy Policy page' ); 200 } else { 201 _e( 'Select a Privacy Policy page' ); 202 } 203 ?> 204 </label></th> 205 <td> 206 <?php 207 $has_pages = (bool) get_posts( 208 array( 209 'post_type' => 'page', 210 'posts_per_page' => 1, 211 'post_status' => array( 212 'publish', 213 'draft', 214 ), 215 ) 216 ); 61 <p> 62 <?php 63 /* translators: %s: https://wordpress.org/about/privacy/ */ 64 printf( __( 'We take privacy and transparency very seriously. To learn more about what data we collect, and how we use it, please visit <a href="%s">WordPress.org/about/privacy</a>.' ), 'https://wordpress.org/about/privacy/' ); 65 ?> 66 </p> 67 </div> 217 68 218 if ( $has_pages ) :219 ?>220 <form method="post" action="">221 <input type="hidden" name="action" value="set-privacy-page" />222 <?php223 wp_dropdown_pages(224 array(225 'name' => 'page_for_privacy_policy',226 'show_option_none' => __( '— Select —' ),227 'option_none_value' => '0',228 'selected' => $privacy_policy_page_id,229 'post_status' => array( 'draft', 'publish' ),230 )231 );232 233 wp_nonce_field( 'set-privacy-page' );234 235 submit_button( __( 'Use This Page' ), 'primary', 'submit', false, array( 'id' => 'set-page' ) );236 ?>237 </form>238 <?php endif; ?>239 240 <form class="wp-create-privacy-page" method="post" action="">241 <input type="hidden" name="action" value="create-privacy-page" />242 <span>243 <?php244 if ( $has_pages ) {245 _e( 'Or:' );246 } else {247 _e( 'There are no pages.' );248 }249 ?>250 </span>251 <?php252 wp_nonce_field( 'create-privacy-page' );253 254 submit_button( __( 'Create New Page' ), 'primary', 'submit', false, array( 'id' => 'create-page' ) );255 ?>256 </form>257 </td>258 </tr>259 </table>260 69 </div> 261 <?php 262 263 include( ABSPATH . 'wp-admin/admin-footer.php' ); 70 <?php include( ABSPATH . 'wp-admin/admin-footer.php' ); ?> -
Property
svn:mergeinfo
set to
(toggle deleted branches)
Note: See TracChangeset
for help on using the changeset viewer.