PluginProbe
UsersWP – Front-end login form, User Registration, User Profile & Members Directory plugin for WP / trunk
UsersWP – Front-end login form, User Registration, User Profile & Members Directory plugin for WP vtrunk
1.2.72 1.2.71 1.2.70 1.2.69 1.2.68 1.2.67 1.2.66 1.2.65 1.2.64 1.2.63 trunk 1.0.10 1.0.11 1.0.12 1.0.13 1.0.14 1.0.15 1.0.16 1.0.17 1.0.18 1.0.19 1.0.20 1.0.21 1.0.22 1.0.23 All 172 releases
userswp / includes / class-uwp-privacy-erasers.php

class-uwp-privacy-erasers.php in UsersWP – Front-end login form, User Registration, User Profile & Members Directory plugin for WP trunk, at includes/class-uwp-privacy-erasers.php

50 lines 1.3 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /**
3 * Personal data erasers.
4 */
5
6 defined( 'ABSPATH' ) || exit;
7
8 /**
9 * UsersWP_Privacy_Erasers Class.
10 */
11 class UsersWP_Privacy_Erasers {
12 /**
13 * Finds and erase user data by email address.
14 *
15 * @since 1.0.14
16 * @param string $email_address The user email address.
17 * @param int $page Page.
18 * @return array An array of user data in name value pairs
19 */
20 public static function user_data_eraser( $email_address, $page ) {
21 $response = array(
22 'items_removed' => false,
23 'items_retained' => false,
24 'messages' => array(),
25 'done' => true,
26 );
27
28 $user = get_user_by( 'email', $email_address );
29
30 if ( ! $user instanceof WP_User ) {
31 return $response;
32 }
33
34 if ( $user && $user->ID ) {
35 uwp_delete_usermeta_row($user->ID);
36 $response['items_removed'] = true;
37 }
38
39 /**
40 * Allow extensions to remove data for this user and adjust the response.
41 *
42 * @since 1.0.14
43 * @param array $response Array resonse data. Must include messages, num_items_removed, num_items_retained, done.
44 * @param WP_User $user user object.
45 */
46 return apply_filters( 'uwp_privacy_erase_personal_data_user', $response, $user );
47 }
48
49 }
50