[wp-trac] [WordPress Trac] #31513: Wrong description in DocBlock of function wp_insert_user()

WordPress Trac noreply at wordpress.org
Tue Mar 3 15:58:58 UTC 2015


#31513: Wrong description in DocBlock of function wp_insert_user()
---------------------------+-----------------------------
 Reporter:  floriansimeth  |      Owner:
     Type:  enhancement    |     Status:  new
 Priority:  normal         |  Milestone:  Awaiting Review
Component:  General        |    Version:  4.1.1
 Severity:  normal         |   Keywords:
  Focuses:  docs           |
---------------------------+-----------------------------
 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
 [https://core.trac.wordpress.org/browser/tags/4.1.1/src/wp-
 includes/user.php#L1689 /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
 ([http://codex.wordpress.org/Function_Reference/wp_insert_user#Notes 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

--
Ticket URL: <https://core.trac.wordpress.org/ticket/31513>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list