[wp-trac] [WordPress Trac] #37338: add filter in get_data_by

WordPress Trac noreply at wordpress.org
Tue Jul 12 10:45:07 UTC 2016


#37338: add filter in get_data_by
-------------------------+-----------------------------
 Reporter:  muhammadn    |      Owner:
     Type:  enhancement  |     Status:  new
 Priority:  normal       |  Milestone:  Awaiting Review
Component:  Users        |    Version:  4.5.3
 Severity:  normal       |   Keywords:
  Focuses:               |
-------------------------+-----------------------------
 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.

--
Ticket URL: <https://core.trac.wordpress.org/ticket/37338>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list