[wp-hackers] Get list of roles

Raj list at expost.org
Sat Sep 11 14:39:04 UTC 2010

Where can this information be fetched from the database?

-----Original Message-----
From: wp-hackers-bounces at lists.automattic.com
[mailto:wp-hackers-bounces at lists.automattic.com] On Behalf Of Peter Westwood
Sent: Saturday, September 11, 2010 2:01 PM
To: wp-hackers at lists.automattic.com
Subject: Re: [wp-hackers] Get list of roles

On 11 Sep 2010, at 08:48, Ryan Bilesky wrote:

> I can't seem to figure out how to get this to work.
> I am trying to get a list of roles, (not just assume there is only the 
> default roles) to build an options page for a plugin I'm working on.  
> I would have table to control what roles get certain custom 
> capabilities.  I cannot seem to figure out how to get all the role 
> names, so I can build my form to change my plugin specific capabilities.

	global $wp_roles;
	var_dump ($wp_roles->get_names());

As long as the global has been setup by the time you call the function.

Peter Westwood
http://blog.ftwr.co.uk | http://westi.wordpress.com C53C F8FC 8796 8508 88D6
C950 54F4 5DCD A834 01C5

wp-hackers mailing list
wp-hackers at lists.automattic.com

More information about the wp-hackers mailing list