From 933ab734f9f9d85c782042022350efcaab60e806 Mon Sep 17 00:00:00 2001 From: Drew Jaynes Date: Sat, 12 Jul 2014 00:08:15 +0000 Subject: [PATCH] Convert default arguments documentation for `wp_dropdown_users()` into a hash notation. See #28841. Built from https://develop.svn.wordpress.org/trunk@29115 git-svn-id: http://core.svn.wordpress.org/trunk@28901 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/user.php | 59 +++++++++++++++++++++++++++----------------- 1 file changed, 37 insertions(+), 22 deletions(-) diff --git a/wp-includes/user.php b/wp-includes/user.php index 1028e2df56..034d409783 100644 --- a/wp-includes/user.php +++ b/wp-includes/user.php @@ -1252,34 +1252,49 @@ function setup_userdata($for_user_id = '') { * used, either 'include' or 'exclude', but not both. * * The available arguments are as follows: - *
    - *
  1. show_option_all - Text to show all and whether HTML option exists.
  2. - *
  3. show_option_none - Text for show none and whether HTML option exists.
  4. - *
  5. option_none_value - Value to use when no option is selected.
  6. - *
  7. hide_if_only_one_author - Don't create the dropdown if there is only one user.
  8. - *
  9. orderby - SQL order by clause for what order the users appear. Default is 'display_name'.
  10. - *
  11. order - Default is 'ASC'. Can also be 'DESC'.
  12. - *
  13. include - User IDs to include.
  14. - *
  15. exclude - User IDs to exclude.
  16. - *
  17. multi - Default is 'false'. Whether to skip the ID attribute on the 'select' element. A 'true' value is overridden when id argument is set.
  18. - *
  19. show - Default is 'display_name'. User table column to display. If the selected item is empty then the user_login will be displayed in parentheses
  20. - *
  21. echo - Default is '1'. Whether to display or retrieve content.
  22. - *
  23. selected - Which User ID is selected.
  24. - *
  25. include_selected - Always include the selected user ID in the dropdown. Default is false.
  26. - *
  27. name - Default is 'user'. Name attribute of select element.
  28. - *
  29. id - Default is the value of the 'name' parameter. ID attribute of select element.
  30. - *
  31. class - Class attribute of select element.
  32. - *
  33. blog_id - ID of blog (Multisite only). Defaults to ID of current blog.
  34. - *
  35. who - Which users to query. Currently only 'authors' is supported. Default is all users.
  36. - *
* * @since 2.3.0 * * @global wpdb $wpdb WordPress database object for queries. * - * @todo Hash-notate arguments array. + * @param array|string $args { + * Optional. Array or string of arguments to generate a drop-down of users. + * {@see WP_User_Query::prepare_query() for additional available arguments. * - * @param string|array $args Optional. Array of user arguments. + * @type string $show_option_all Text to show as the drop-down default (all). + * Default empty. + * @type string $show_option_none Text to show as the drop-down default when no + * users were found. Default empty. + * @type int|string $option_none_value Value to use for $show_option_non when no users + * were found. Default -1. + * @type string $hide_if_only_one_author Whether to skip generating the drop-down + * if only one user was found. Default empty. + * @type string $orderby Field to order found users by. Accepts user fields. + * Default 'display_name'. + * @type string $order Whether to order users in ascending or descending + * order. Accepts 'ASC' (ascending) or 'DESC' (descending). + * Default 'ASC'. + * @type array|string $include Array or comma-separated list of user IDs to include. + * Default empty. + * @type array|string $exclude Array or comma-separated list of user IDs to exclude. + * Default empty. + * @type bool|int $multi Whether to skip the ID attribute on the 'select' element. + * Accepts 1|true or 0|false. Default 0|false. + * @type string $show User table column to display. If the selected item is empty + * then the 'user_login' will be displayed in parentheses. + * Accepts user fields. Default 'display_name'. + * @type int|bool $echo Whether to echo or return the drop-down. Accepts 1|true (echo) + * or 0|false (return). Default 1|true. + * @type int $selected Which user ID should be selected. Default 0. + * @type bool $include_selected Whether to always include the selected user ID in the drop- + * down. Default false. + * @type string $name Name attribute of select element. Default 'user'. + * @type string $id ID attribute of the select element. Default is the value of $name. + * @type string $class Class attribute of the select element. Default empty. + * @type int $blog_id ID of blog (Multisite only). Default is ID of the current blog. + * @type string $who Which type of users to query. Accepts only an empty string or + * 'authors'. Default empty. + * } * @return string|null Null on display. String of HTML content on retrieve. */ function wp_dropdown_users( $args = '' ) {