Make WordPress Core

Opened 5 years ago

Last modified 5 years ago

#23192 closed enhancement

Use get_user_by() in is_user_spammy() — at Version 2

Reported by: ocean90 Owned by:
Milestone: 3.6 Priority: normal
Severity: normal Version:
Component: Multisite Keywords: has-patch commit needs-unit-tests
Focuses: Cc:

Description (last modified by SergeyBiryukov)

Comes up after reading #23190.

Since is_user_spammy expects a user name, we should replace get_user_id_from_string( $username ) with get_user_by( 'login', $username ). Same for the id.

Change History (3)

5 years ago

#1 @ocean90
5 years ago

  • Keywords has-patch added

#2 @SergeyBiryukov
5 years ago

  • Description modified (diff)
  • Keywords 2nd-opinion removed
  • Milestone changed from Awaiting Review to 3.6

I agree. We could then deprecate get_user_id_from_string(), since it's the only instance in core.

Note: See TracTickets for help on using tickets.