#23192 closed enhancement (fixed)
Use get_user_by() in is_user_spammy()
| Reported by: |
|
Owned by: |
|
|---|---|---|---|
| Priority: | normal | Milestone: | 3.6 |
| Component: | Multisite | Version: | |
| Severity: | normal | Keywords: | has-patch commit needs-unit-tests |
| Cc: | bananastalktome@… |
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.
Attachments (3)
Change History (11)
comment:2
SergeyBiryukov — 4 months ago
- Description modified (diff)
- Keywords 2nd-opinion removed
- Milestone changed from Awaiting Review to 3.6
comment:3
SergeyBiryukov — 4 months ago
- Keywords commit added
- Keywords needs-unit-tests added
Looks good. Let's add some simple unit tests.
bananastalktome — 3 months ago
comment:6
SergeyBiryukov — 3 months ago
In 1216/tests:
comment:7
SergeyBiryukov — 3 months ago
- Owner set to SergeyBiryukov
- Resolution set to fixed
- Status changed from new to closed
In 23431:
comment:8
SergeyBiryukov — 3 months ago
In 23432:
Note: See
TracTickets for help on using
tickets.

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