Changeset 43098
- Timestamp:
- 05/02/2018 02:45:22 AM (7 years ago)
- Location:
- branches/4.9
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/4.9
-
branches/4.9/src/wp-admin/about.php
r42933 r43098 28 28 <a href="credits.php" class="nav-tab"><?php _e( 'Credits' ); ?></a> 29 29 <a href="freedoms.php" class="nav-tab"><?php _e( 'Freedoms' ); ?></a> 30 <a href=" privacy.php" class="nav-tab"><?php _e( 'Privacy' ); ?></a>30 <a href="freedoms.php?privacy-notice" class="nav-tab"><?php _e( 'Privacy' ); ?></a> 31 31 </h2> 32 32 -
branches/4.9/src/wp-admin/credits.php
r43033 r43098 29 29 <a href="credits.php" class="nav-tab nav-tab-active"><?php _e( 'Credits' ); ?></a> 30 30 <a href="freedoms.php" class="nav-tab"><?php _e( 'Freedoms' ); ?></a> 31 <a href=" privacy.php" class="nav-tab"><?php _e( 'Privacy' ); ?></a>31 <a href="freedoms.php?privacy-notice" class="nav-tab"><?php _e( 'Privacy' ); ?></a> 32 32 </h2> 33 33 -
branches/4.9/src/wp-admin/freedoms.php
r42158 r43098 15 15 16 16 include( ABSPATH . 'wp-admin/admin-header.php' ); 17 18 $is_privacy_notice = isset( $_GET['privacy-notice'] ); 19 17 20 ?> 18 21 <div class="wrap about-wrap full-width-layout"> … … 27 30 <a href="about.php" class="nav-tab"><?php _e( 'What’s New' ); ?></a> 28 31 <a href="credits.php" class="nav-tab"><?php _e( 'Credits' ); ?></a> 29 <a href="freedoms.php" class="nav-tab nav-tab-active"><?php _e( 'Freedoms' ); ?></a>30 <a href=" privacy.php" class="nav-tab"><?php _e( 'Privacy' ); ?></a>32 <a href="freedoms.php" class="nav-tab<?php if ( ! $is_privacy_notice ) { echo ' nav-tab-active'; } ?>"><?php _e( 'Freedoms' ); ?></a> 33 <a href="freedoms.php?privacy-notice" class="nav-tab<?php if ( $is_privacy_notice ) { echo ' nav-tab-active'; } ?>"><?php _e( 'Privacy' ); ?></a> 31 34 </h2> 32 35 36 <?php if ( $is_privacy_notice ) : ?> 37 38 <div class="about-wrap-content"> 39 <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> 40 41 <p><?php 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/' ); ?></p> 42 43 <p><?php 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/' ); ?></p> 44 </div> 45 46 <?php else : ?> 33 47 <div class="about-wrap-content"> 34 48 <p class="about-description"><?php printf( __( 'WordPress is Free and open source software, built by a distributed community of mostly volunteer developers from around the world. WordPress comes with some awesome, worldview-changing rights courtesy of its <a href="%s">license</a>, the GPL.' ), 'https://wordpress.org/about/license/' ); ?></p> … … 53 67 </div> 54 68 69 <?php endif; ?> 55 70 </div> 56 71 <?php include( ABSPATH . 'wp-admin/admin-footer.php' ); ?> -
branches/4.9/src/wp-admin/menu.php
r41268 r43098 245 245 $submenu['tools.php'][10] = array( __('Import'), 'import', 'import.php' ); 246 246 $submenu['tools.php'][15] = array( __('Export'), 'export', 'export.php' ); 247 $submenu['tools.php'][20] = array( __( 'Privacy' ), 'manage_options', 'privacy.php' ); 247 248 if ( is_multisite() && !is_main_site() ) 248 249 $submenu['tools.php'][25] = array( __('Delete Site'), 'delete_site', 'ms-delete-site.php' ); -
branches/4.9/src/wp-admin/privacy.php
-
Property
svn:eol-style
set to
native
r42158 r43098 1 1 <?php 2 2 /** 3 * Privacy administration panel.3 * Privacy Tools Screen. 4 4 * 5 5 * @package WordPress … … 10 10 require_once( dirname( __FILE__ ) . '/admin.php' ); 11 11 12 $title = __( 'Privacy' ); 13 14 list( $display_version ) = explode( '-', get_bloginfo( 'version' ) ); 15 16 include( ABSPATH . 'wp-admin/admin-header.php' ); 12 if ( ! current_user_can( 'manage_options' ) ) { 13 wp_die( __( 'Sorry, you are not allowed to manage privacy on this site.' ) ); 14 } 15 16 // "Borrow" xfn.js for now so we don't have to create new files. 17 // wp_enqueue_script( 'xfn' ); 18 19 $action = isset( $_POST['action'] ) ? $_POST['action'] : ''; 20 21 if ( ! empty( $action ) ) { 22 check_admin_referer( $action ); 23 24 if ( 'set-privacy-page' === $action ) { 25 $privacy_policy_page_id = isset( $_POST['page_for_privacy_policy'] ) ? (int) $_POST['page_for_privacy_policy'] : 0; 26 update_option( 'wp_page_for_privacy_policy', $privacy_policy_page_id ); 27 28 add_settings_error( 29 'page_for_privacy_policy', 30 'page_for_privacy_policy', 31 __( 'Privacy policy page updated successfully.' ), 32 'updated' 33 ); 34 } elseif ( 'create-privacy-page' === $action ) { 35 $privacy_policy_page_id = wp_insert_post( 36 array( 37 'post_title' => __( 'Privacy Policy' ), 38 'post_status' => 'draft', 39 'post_type' => 'page', 40 ), 41 true 42 ); 43 44 if ( is_wp_error( $privacy_policy_page_id ) ) { 45 add_settings_error( 46 'page_for_privacy_policy', 47 'page_for_privacy_policy', 48 __( 'Unable to create privacy policy page.' ), 49 'error' 50 ); 51 } else { 52 update_option( 'wp_page_for_privacy_policy', $privacy_policy_page_id ); 53 add_settings_error( 54 'page_for_privacy_policy', 55 'page_for_privacy_policy', 56 __( 'Privacy policy page created successfully.' ), 57 'updated' 58 ); 59 } 60 } 61 } 62 63 // If a privacy policy page ID is available, make sure the page actually exists. If not, display a warning 64 $privacy_policy_page_exists = false; 65 $privacy_policy_page_id = (int) get_option( 'wp_page_for_privacy_policy' ); 66 67 if ( ! empty( $privacy_policy_page_id ) ) { 68 $privacy_policy_page = get_post( $privacy_policy_page_id ); 69 if ( ! $privacy_policy_page instanceof WP_Post ) { 70 add_settings_error( 71 'page_for_privacy_policy', 72 'page_for_privacy_policy', 73 __( 'The currently selected privacy policy page does not exist. Please create or select new page.' ), 74 'warning' 75 ); 76 } 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 } 90 } 91 } 92 93 $title = __( 'Privacy Tools' ); 94 95 get_current_screen()->add_help_tab( array( 96 'id' => 'privacy', 97 'title' => __( 'Privacy' ), 98 'content' => '<p>' . __( 'This page provides tools with which you can manage your user\'s personal data and site\'s privacy policy.' ) . '</p>', 99 ) ); 100 101 get_current_screen()->set_help_sidebar( 102 '<p><strong>' . __( 'For more information:' ) . '</strong></p>' . 103 '<p>' . __( '<a href="#">Documentation on privacy</a>' ) . '</p>' 104 ); 105 106 require_once( ABSPATH . 'wp-admin/admin-header.php' ); 107 17 108 ?> 18 <div class="wrap about-wrap full-width-layout"> 19 20 <h1><?php printf( __( 'Welcome to WordPress %s' ), $display_version ); ?></h1> 21 22 <p class="about-text"><?php printf( __( 'Thank you for updating to the latest version! WordPress %s will smooth your design workflow and keep you safe from coding errors.' ), $display_version ); ?></p> 23 24 <div class="wp-badge"><?php printf( __( 'Version %s' ), $display_version ); ?></div> 25 26 <h2 class="nav-tab-wrapper wp-clearfix"> 27 <a href="about.php" class="nav-tab"><?php _e( 'What’s New' ); ?></a> 28 <a href="credits.php" class="nav-tab"><?php _e( 'Credits' ); ?></a> 29 <a href="freedoms.php" class="nav-tab"><?php _e( 'Freedoms' ); ?></a> 30 <a href="privacy.php" class="nav-tab nav-tab-active"><?php _e( 'Privacy' ); ?></a> 31 </h2> 32 33 <div class="about-wrap-content"> 34 <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> 35 36 <p><?php 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/' ); ?></p> 37 38 <p><?php 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/' ); ?></p> 109 <div class="wrap"> 110 <h1><?php echo esc_html( $title ); ?></h1> 111 <?php settings_errors(); ?> 112 113 <h2 class="title"><?php _e( 'Privacy policy page' ); ?></h2> 114 <table class="form-table"> 115 <?php 116 117 if ( $privacy_policy_page_exists ) { 118 $edit_href = add_query_arg( 119 array( 120 'post' => $privacy_policy_page_id, 121 'action' => 'edit', 122 ), 123 admin_url( 'post.php' ) 124 ); 125 $view_href = get_permalink( $privacy_policy_page_id ); 126 127 ?> 128 <tr> 129 <th colspan="2"> 130 <?php 131 printf( 132 __( '<a href="%1$s">Edit</a> or <a href="%2$s">view</a> your privacy policy.' ), 133 $edit_href, 134 $view_href 135 ); 136 ?> 137 </th> 138 </tr> 139 <?php 140 } 141 142 ?> 143 <tr> 144 <th scope="row"> 145 <?php 146 147 if ( $privacy_policy_page_exists ) { 148 _e( 'Select another page for your privacy policy' ); 149 } else { 150 _e( 'Select an existing privacy policy page' ); 151 } 152 153 ?> 154 </th> 155 <td id="front-static-pages"> 156 <form method="post" action=""> 157 <?php wp_nonce_field( 'set-privacy-page' ); ?> 158 <input type="hidden" name="action" value="set-privacy-page" /> 159 <fieldset> 160 <legend class="screen-reader-text"><span><?php _e( 'Select your privacy policy page.' ); ?></span></legend> 161 <label for="page_for_privacy_policy"> 162 <?php wp_dropdown_pages( 163 array( 164 'name' => 'page_for_privacy_policy', 165 'show_option_none' => __( '— Select —' ), 166 'option_none_value' => '0', 167 'selected' => $privacy_policy_page_id, 168 'post_status' => array( 'draft', 'publish' ), 169 ) 170 ); 171 ?> 172 </label> 173 </fieldset> 174 <?php submit_button( __( 'Set Page' ) ); ?> 175 </form> 176 </td> 177 </tr> 178 <?php 179 180 if ( ! $privacy_policy_page_exists ) { 181 ?> 182 <tr> 183 <th scope="row"><?php _e( 'Create new page for your privacy policy' ); ?></th> 184 <td> 185 <form method="post" action=""> 186 <input type="hidden" name="action" value="create-privacy-page" /> 187 <?php wp_nonce_field( 'create-privacy-page' ); ?> 188 <?php submit_button( __( 'Create Page' ) ); ?> 189 </form> 190 </td> 191 </tr> 192 <?php 193 } 194 195 ?> 196 </table> 39 197 </div> 40 198 41 </div> 42 <?php include( ABSPATH . 'wp-admin/admin-footer.php' ); ?> 199 <?php 200 201 include( ABSPATH . 'wp-admin/admin-footer.php' ); -
Property
svn:eol-style
set to
Note: See TracChangeset
for help on using the changeset viewer.