Make WordPress Core


Ignore:
Timestamp:
11/05/2019 09:21:46 PM (5 years ago)
Author:
johnbillion
Message:

Docs: Improve documentation of known return types, plus other docs fixes.

See #48303

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/user.php

    r46640 r46660  
    396396 * @global wpdb $wpdb WordPress database abstraction object.
    397397 *
    398  * @param array        $users       Array of user IDs.
    399  * @param string|array $post_type   Optional. Single post type or array of post types to check. Defaults to 'post'.
    400  * @param bool         $public_only Optional. Only return counts for public posts.  Defaults to false.
    401  * @return array Amount of posts each user has written.
     398 * @param int[]           $users       Array of user IDs.
     399 * @param string|string[] $post_type   Optional. Single post type or array of post types to check. Defaults to 'post'.
     400 * @param bool            $public_only Optional. Only return counts for public posts.  Defaults to false.
     401 * @return string[] Amount of posts each user has written, as strings, keyed by user ID.
    402402 */
    403403function count_many_users_posts( $users, $post_type = 'post', $public_only = false ) {
     
    866866 *                           Accepts either 'time' or 'memory'. Default 'time'.
    867867 * @param int|null $site_id  Optional. The site ID to count users for. Defaults to the current site.
    868  * @return array Includes a grand total and an array of counts indexed by role strings.
     868 * @return array {
     869 *     User counts.
     870 *
     871 *     @type int   $total_users Total number of users on the site.
     872 *     @type int[] $avail_roles Array of user counts keyed by user role.
     873 * }
    869874 */
    870875function count_users( $strategy = 'time', $site_id = null ) {
     
    21722177 *
    21732178 * @param WP_User $user WP_User instance.
    2174  * @return array List of user keys to be populated in wp_update_user().
     2179 * @return string[] List of user keys to be populated in wp_update_user().
    21752180 */
    21762181function _get_additional_user_keys( $user ) {
     
    21872192 *
    21882193 * @param WP_User $user Optional. WP_User object.
    2189  * @return array Array of contact methods and their labels.
     2194 * @return string[] Array of contact method labels keyed by contact method.
    21902195 */
    21912196function wp_get_user_contact_methods( $user = null ) {
     
    22042209     * @since 2.9.0
    22052210     *
    2206      * @param array   $methods Array of contact methods and their labels.
    2207      * @param WP_User $user    WP_User object.
     2211     * @param string[] $methods Array of contact method labels keyed by contact method.
     2212     * @param WP_User  $user    WP_User object.
    22082213     */
    22092214    return apply_filters( 'user_contactmethods', $methods, $user );
     
    22192224 *
    22202225 * @param WP_User $user Optional. WP_User object. Default null.
    2221  * @return array Array of contact methods and their labels.
     2226 * @return string[] Array of contact method labels keyed by contact method.
    22222227 */
    22232228function _wp_get_user_contactmethods( $user = null ) {
     
    26612666 *
    26622667 * @param int|null $site_id Optional. The site ID to get users with no role for. Defaults to the current site.
    2663  * @return array Array of user IDs.
     2668 * @return string[] Array of user IDs as strings.
    26642669 */
    26652670function wp_get_users_with_no_role( $site_id = null ) {
Note: See TracChangeset for help on using the changeset viewer.