WordPress.org

Make WordPress Core

Opened 17 months ago

#37338 new enhancement

add filter in get_data_by

Reported by: muhammadn Owned by:
Milestone: Awaiting Review Priority: normal
Severity: normal Version: 4.5.3
Component: Users Keywords:
Focuses: Cc:

Description

Basically I need to encrypt user_email field in the database,
I can enrypt them using following filters:

email_change_email
pre_user_email

now what i need is to decrypt them when getting retrieved from database,
as far as I say in the core, this may be done by applying a new filter in wp-includes\class-wp-user.php#get_data_by( $field, $value ) method, right before this line

update_user_caches( $user ); (LN:239)

for this to work, $value needs to be filtered based on $field as well (cause this is the value that sits in the query in Line# 235, so I think three filters in Line# 207 switch branches should do the trick.

Change History (0)

Note: See TracTickets for help on using tickets.