WordPress.org

Make WordPress Core

Opened 8 years ago

Last modified 4 months ago

#15145 new enhancement

Add a wp_list_users() template tag

Reported by: greenshady Owned by:
Milestone: Future Release Priority: normal
Severity: normal Version: 3.1
Component: Users Keywords: has-patch dev-feedback needs-refresh
Focuses: template Cc:

Description

Now that get_users() has been implemented (#14572), I propose we add a function called wp_list_users() that handles a basic list of users similar to wp_list_authors(). WordPress has long needed a function for handling this.

The arguments for the function would simply be the same arguments used for get_users(). The wp_list_users() function would basically be a function for outputting the HTML. The function should also have the ability to link to the user's archive page and output a link to the user's RSS feed.

This would make it easy for theme developers and users to be able to create a users list without a lot of PHP work.

An alternate idea might be to push a few more arguments into the wp_list_authors() function, but I don't think that's the best route to go since its primary function is to list users that have written posts.

Attachments (2)

15145.diff (4.3 KB) - added by rohan013 4 years ago.
Adds a new function wp_list_users() which is very similar to wp_list_authors except the 'optioncount' and 'hide_empty' args since they are not valid here.
15145.2.diff (4.3 KB) - added by Mte90 11 months ago.
patch refreshed

Download all attachments as: .zip

Change History (11)

#1 @scribu
8 years ago

  • Cc scribu added
  • Component changed from Users to Template

#2 @Utkarsh
8 years ago

  • Cc admin@… added

#3 @markjaquith
7 years ago

  • Milestone changed from Awaiting Review to Future Release

#4 @nacin
4 years ago

  • Component changed from Template to Users
  • Focuses template added
  • Keywords needs-patch added

Would need a patch.

@rohan013
4 years ago

Adds a new function wp_list_users() which is very similar to wp_list_authors except the 'optioncount' and 'hide_empty' args since they are not valid here.

#5 @rohan013
4 years ago

  • Keywords has-patch added; needs-patch removed

#6 @chriscct7
3 years ago

  • Keywords needs-refresh added

@Mte90
11 months ago

patch refreshed

#7 @Mte90
11 months ago

  • Keywords dev-feedback added; needs-refresh removed

This ticket was mentioned in Slack in #core by mte90. View the logs.


4 months ago

#9 @afercia
4 months ago

  • Keywords needs-refresh added

In 15145.2.diff naming a variable $return is potentially confusing, for better code readability I'd suggest to rename it. Also needs some minor coding standards.

Note: See TracTickets for help on using tickets.