Make WordPress Core

Changes between Initial Version and Version 1 of Ticket #58152, comment 2


Ignore:
Timestamp:
04/19/2023 11:33:40 PM (2 years ago)
Author:
SergeyBiryukov
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #58152, comment 2

    initial v1  
    33It looks like the purpose of the `$spam` variable here is to be included in the `compact()` call in [source:tags/6.2/src/wp-includes/user.php?marks=2330#L2321 line 2330].
    44
    5 Reading the [source:tags/6.2/src/wp-includes/user.php?marks=2330#L2450 DocBlock above the suggested change], it makes it immediately clear what `$userdata` is: the raw array of data passed to `wp_insert_user()`, and `$userdata['spam']` is a part of that array. This naming also seems more consistent when being compared with `$old_user_data->spam`.
     5Reading the [source:tags/6.2/src/wp-includes/user.php#L2450 DocBlock above the suggested change], it makes it immediately clear what `$userdata` is: the raw array of data passed to `wp_insert_user()`, and `$userdata['spam']` is a part of that array. This naming also seems more consistent when being compared with `$old_user_data->spam`.
    66
    77If we replace it with `$spam`, anyone reviewing the code would then have to spend some more time to find where that variable is defined.