Make WordPress Core

Opened 9 years ago

Closed 9 years ago

#31588 closed defect (bug) (fixed)

Some params missing docs in `wp_insert_user()`; `$userdata` handled unexpectedly

Reported by: dlh's profile dlh Owned by: wonderboymusic's profile wonderboymusic
Milestone: 4.3 Priority: normal
Severity: normal Version:
Component: Users Keywords: has-patch commit
Focuses: Cc:


The current docs for wp_insert_user() include some parameters no longer accepted by default, and a few other parameters are missing.

The attached patch:

  • removes the old default contact methods from the $userdata hash notation;
  • adds docs for $description, $comment_shortcuts, $admin_color, $use_ssl, and $show_admin_bar_front;
  • fixes a typo in the short description, and generalizes the note in the long description about available filters so it doesn't have to keep up with every new one;
  • tries to clarify $first_name and $last_name, if I understood them correctly.

The patch also makes a related change to the handling of $comment_shortcuts.

Currently, if $userdata['comment_shortcuts'] = true, the meta value will be 1. But enqueue_comment_hotkeys_js() checks for the string 'true', which is also what edit_user() saves.

With this change, the meta value would be 'true' if $userdata['comment_shortcuts'] is any non-empty value except 'false'.

Attachments (3)

31588.patch (6.3 KB) - added by dlh 9 years ago.
31588.diff (6.5 KB) - added by rachelbaker 9 years ago.
Retains the verbose pre_user_ filter information and updates the exceptions. Also corrects string typo.
31588.2.diff (1.4 KB) - added by DrewAPicture 9 years ago.
Tests update + argument

Download all attachments as: .zip

Change History (11)

9 years ago

#1 @DrewAPicture
9 years ago

  • Keywords has-patch added
  • Version trunk deleted

#2 @rachelbaker
9 years ago

  • Keywords needs-refresh added
  • Milestone changed from Awaiting Review to Future Release

Looks like there is still a typo in the word string on this line:

@type stirng      $last_name   The user's last name. For new users, will be used 

9 years ago

Retains the verbose pre_user_ filter information and updates the exceptions. Also corrects string typo.

#3 @rachelbaker
9 years ago

  • Keywords needs-refresh removed
  • Milestone changed from Future Release to 4.3

#4 @netweb
9 years ago

  • Owner set to DrewAPicture
  • Status changed from new to assigned

#5 @DrewAPicture
9 years ago

  • Status changed from assigned to accepted

#6 @DrewAPicture
9 years ago

In 32884:

Update the DocBlock for wp_insert_post() to exclude now-defunct contact method arguments and clarify others.

Also clarifies information on available hooks and adds a changelog entry for when the contact method arguments were removed.

Props dlh, rachelbaker.
See #31588.

9 years ago

Tests update + argument

#7 @DrewAPicture
9 years ago

  • Focuses docs removed
  • Keywords commit added
  • Owner DrewAPicture deleted
  • Status changed from accepted to assigned

[32884] took care of updating the documentation portion of 31588.diff.

I split out the code and unit tests changes to 31588.2.diff, which will need code committer review.

#8 @wonderboymusic
9 years ago

  • Owner set to wonderboymusic
  • Resolution set to fixed
  • Status changed from assigned to closed

In 32904:

After [32884], update the default value for comment_shortcuts.

Props dlh, rachelbaker, DrewAPicture.
Fixes #31588.

Note: See TracTickets for help on using tickets.