[wp-trac] [WordPress Trac] #48508: User cache needs to be cleaned after updating user_activation_key via wpdb

WordPress Trac noreply at wordpress.org
Tue Feb 25 16:57:50 UTC 2025


#48508: User cache needs to be cleaned after updating user_activation_key via wpdb
--------------------------+-------------------------
 Reporter:  david.binda   |       Owner:  (none)
     Type:  defect (bug)  |      Status:  closed
 Priority:  normal        |   Milestone:
Component:  Users         |     Version:
 Severity:  normal        |  Resolution:  worksforme
 Keywords:                |     Focuses:
--------------------------+-------------------------
Changes (by johnjamesjacoby):

 * status:  new => closed
 * resolution:   => worksforme
 * milestone:  Awaiting Review =>


Comment:

 Going to close this ticket as there does not appear to be an opportunity
 to improve the WordPress core code itself. If I'm incorrect, please feel
 free to reopen! 😅

 Like @davidbinda already mentioned, switching to `get_user_by()` and
 `wp_update_user ()` was intentional, and integrating the user cache there
 means direct database queries elsewhere may have problematic consequences.

 When plugins/themes use `$wpdb` to update database rows directly, they
 have a responsibility to clean the caches related to their queries at the
 same time.

 (Which caches to clean can be a mystery sometimes, but improved docs & AI
 tooling is helping with this, etc...)

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/48508#comment:1>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list