Opened 10 years ago
Closed 10 years ago
#31513 closed defect (bug) (fixed)
Wrong description in DocBlock of function wp_insert_user()
Reported by: | floriansimeth | Owned by: | DrewAPicture |
---|---|---|---|
Milestone: | 4.2 | Priority: | normal |
Severity: | normal | Version: | 4.1 |
Component: | Users | Keywords: | |
Focuses: | docs | Cc: |
Description
Hey WP-Community,
I hope you all doing good.
I've found out that the variable name in the DocBlock of the wp_insert_user()
in file /wp-includes/user.php (line 1689) is wrong.
The parameter $date_registered
should be renamed to $user_registered
. I don't know really why this parameter is called $user_registered
as the value gets saved into the database table cell named date_registered
.
I've tested that
wp_insert_user( array( 'date_registered' => '2010-12-05 10:00:01', 'user_pass' => 'test', 'user_login' => 'testperson', ) );
will not work whereas
wp_insert_user( array( 'user_registered' => '2010-12-05 10:00:01', 'user_pass' => 'test', 'user_login' => 'testperson', ) );
will do the trick (writes the date into the database correctly). So user_registered
is right (as the documentation suggests).
I know that this is just a small thing. However it's confusing if one constantly takes a look into the core code instead of the documentation.
Thanks
Hi floriansimeth,
Nice catch! The patch looks good, and we should be able to get this in for 4.2 no problem. Thanks for the patch.
This was introduced in [29116].