The functions that I am aware of:

WP_User

and

wp_get_current_user

seem to only get the user object of the current user. As an administrator, if I want to display certain profile information in a table from each user, how can I loop through the ids?

Can this be done with WP template tags or should I resort to SQL?

Thanks in advance

有帮助吗?

解决方案

How about using get_users()? You probably don't even need parameters for it, default behavior should be just what you're looking for.

其他提示

get_users() documentation has moved to a new location from the codex link provided by mor7ifer. Here is the new link to save an extra click:

get_users() documentation: https://developer.wordpress.org/reference/functions/get_users/

I don't have the reputation to comment yet, otherwise would have just asked to change the link in the existing solution.

许可以下: CC-BY-SA归因
scroll top