Ticket #48794: 48794.1.patch
File 48794.1.patch, 4.9 KB (added by , 17 months ago) |
---|
-
src/wp-admin/user-edit.php
336 336 </td> 337 337 </tr> 338 338 339 <tr class="pii-info pii-info-status"> 340 <th scope="row"><?php _e( 'PII Status' ); ?></th> 341 <td> 342 <label for="pii-info-status-front"> 343 <input name="pii_info_front" type="checkbox" id="pii_info_front" value="1"<?php checked( _get_pii_pref( $profileuser->ID ) ); ?> /> 344 <?php _e( 'Do you wish to share your info under Personal Identifiable Information?' ); ?> 345 </label><br /> 346 </td> 347 </tr> 348 339 349 <?php 340 350 $languages = get_available_languages(); 341 351 if ( $languages ) : -
src/wp-includes/load.php
1553 1553 1554 1554 return false; 1555 1555 } 1556 1557 /** 1558 * Determines if PPI is enable. 1559 * 1560 * @since 5.3.* 1561 * 1562 * @param int $user Required ID of the user to check. 1563 * @return bool Whether PII is enable for this user or not. 1564 */ 1565 function is_pii( $user ) { 1566 $pref = get_user_option( "share_pii_info", $user ); 1567 if ( false === $pref ) { 1568 return true; 1569 } 1570 1571 return 'true' === $pref; 1572 } -
src/wp-includes/user.php
1517 1517 * site's front end. Default true. 1518 1518 * @type string $role User's role. 1519 1519 * @type string $locale User's locale. Default empty. 1520 * @type bool $share_pii_info Whether to share information for the user. 1521 * Default true. 1520 1522 * } 1521 1523 * @return int|WP_Error The newly created user's ID or a WP_Error object if the user could not 1522 1524 * be created. … … 1758 1760 1759 1761 $meta['locale'] = isset( $userdata['locale'] ) ? $userdata['locale'] : ''; 1760 1762 1763 $meta['share_pii_info'] = empty( $userdata['share_pii_info'] ) ? 'true' : $userdata['share_pii_info']; 1764 1761 1765 $compacted = compact( 'user_pass', 'user_nicename', 'user_email', 'user_url', 'user_registered', 'user_activation_key', 'display_name' ); 1762 1766 $data = wp_unslash( $compacted ); 1763 1767 … … 1834 1838 * @type bool $show_admin_bar_front Whether to show the admin bar on the front end for the user. 1835 1839 * Default true. 1836 1840 * @type string $locale User's locale. Default empty. 1841 * @type bool $share_pii_info Whether to share information for the user. 1842 * Default true. 1837 1843 * } 1838 1844 * @param WP_User $user User object. 1839 1845 * @param bool $update Whether the user is being updated rather than created. … … 2179 2185 * @return string[] List of user keys to be populated in wp_update_user(). 2180 2186 */ 2181 2187 function _get_additional_user_keys( $user ) { 2182 $keys = array( 'first_name', 'last_name', 'nickname', 'description', 'rich_editing', 'syntax_highlighting', 'comment_shortcuts', 'admin_color', 'use_ssl', 'show_admin_bar_front', 'locale' );2188 $keys = array( 'first_name', 'last_name', 'nickname', 'description', 'rich_editing', 'syntax_highlighting', 'comment_shortcuts', 'admin_color', 'use_ssl', 'show_admin_bar_front', 'locale', 'share_pii_info' ); 2183 2189 return array_merge( $keys, array_keys( wp_get_user_contact_methods( $user ) ) ); 2184 2190 } 2185 2191 -
src/wp-includes/admin-bar.php
1232 1232 1233 1233 return 'true' === $pref; 1234 1234 } 1235 1236 /** 1237 * Retrieve the PII preference of a user. 1238 * 1239 * @since 5.3.* 1240 * @access private 1241 * 1242 * @param int $user Optional. ID of the user to check, defaults to 0 for current user. 1243 * @return bool Whether PII is enable for this user or not. 1244 */ 1245 function _get_pii_pref( $user = 0 ) { 1246 $pref = get_user_option( "share_pii_info", $user ); 1247 if ( false === $pref ) { 1248 return true; 1249 } 1250 1251 return 'true' === $pref; 1252 } -
src/wp-admin/includes/user.php
117 117 $user->syntax_highlighting = isset( $_POST['syntax_highlighting'] ) && 'false' === $_POST['syntax_highlighting'] ? 'false' : 'true'; 118 118 $user->admin_color = isset( $_POST['admin_color'] ) ? sanitize_text_field( $_POST['admin_color'] ) : 'fresh'; 119 119 $user->show_admin_bar_front = isset( $_POST['admin_bar_front'] ) ? 'true' : 'false'; 120 $user->share_pii_info = isset( $_POST['pii_info_front'] ) ? 'true' : 'false'; 120 121 $user->locale = ''; 121 122 122 123 if ( isset( $_POST['locale'] ) ) {