From c0052b6af2c4587b0e0febdd1ccd6eccadac4bea Mon Sep 17 00:00:00 2001 From: Drew Jaynes Date: Sat, 12 Jul 2014 00:21:15 +0000 Subject: [PATCH] Convert default arguments documentation for `wp_insert_user()` into a hash notation. See #28841. Built from https://develop.svn.wordpress.org/trunk@29116 git-svn-id: http://core.svn.wordpress.org/trunk@28902 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/user.php | 51 ++++++++++++++++++++++---------------------- 1 file changed, 26 insertions(+), 25 deletions(-) diff --git a/wp-includes/user.php b/wp-includes/user.php index 034d409783..d0e276b22f 100644 --- a/wp-includes/user.php +++ b/wp-includes/user.php @@ -1579,36 +1579,37 @@ function validate_username( $username ) { * by the field name. An example using 'description' would have the filter * called, 'pre_user_description' that can be hooked into. * - * The $userdata array can contain the following fields: - * 'ID' - An integer that will be used for updating an existing user. - * 'user_pass' - A string that contains the plain text password for the user. - * 'user_login' - A string that contains the user's username for logging in. - * 'user_nicename' - A string that contains a URL-friendly name for the user. - * The default is the user's username. - * 'user_url' - A string containing the user's URL for the user's web site. - * 'user_email' - A string containing the user's email address. - * 'display_name' - A string that will be shown on the site. Defaults to user's - * username. It is likely that you will want to change this, for appearance. - * 'nickname' - The user's nickname, defaults to the user's username. - * 'first_name' - The user's first name. - * 'last_name' - The user's last name. - * 'description' - A string containing content about the user. - * 'rich_editing' - A string for whether to enable the rich editor. False - * if not empty. - * 'user_registered' - The date the user registered. Format is 'Y-m-d H:i:s'. - * 'role' - A string used to set the user's role. - * 'jabber' - User's Jabber account. - * 'aim' - User's AOL IM account. - * 'yim' - User's Yahoo IM account. - * * @since 2.0.0 * * @global wpdb $wpdb WordPress database object for queries. * - * @todo Hash-notate arguments array. + * @param array $userdata { + * An array, object, or WP_User object of user data arguments. * - * @param mixed $userdata An array of user data or a user object of type stdClass or WP_User. - * @return int|WP_Error The newly created user's ID or a WP_Error object if the user could not be created. + * @type int $ID User ID. If supplied, the user will be updated. + * @type string $user_pass The plain-text user password. + * @type string $user_login The user's login username. + * @type string $user_nicename The URL-friendly user name. + * @type string $user_url The user URL. + * @type string $user_email The user email address. + * @type string $display_name The user's display name. + * Default is the the user's username. + * @type string $nickname The user's nickname. Default + * Default is the the user's username. + * @type string $first_name The user's first name. For new users, will be used + * to build $display_name if unspecified. + * @type stirng $last_name The user's last name. For new users, will be used + * to build $display_name if unspecified. + * @type string|bool $rich_editing Whether to enable the rich-editor for the user. False + * if not empty. + * @type string $date_registered Date the user registered. Format is 'Y-m-d H:i:s'. + * @type string $role User's role. + * @type string $jabber User's Jabber account username. + * @type string $aim User's AIM account username. + * @type string $yim User's Yahoo! messenger username. + * } + * @return int|WP_Error The newly created user's ID or a WP_Error object if the user could not + * be created. */ function wp_insert_user( $userdata ) { global $wpdb;