I am new to wordpress, in table wp_usermeta
I notice that we have a row
meta_key meta_value
wp_capabilities a:1:{s:13:"administrator";b:1;}
First, what’s the meaning of meta_value a:1:{s:13:"administrator";b:1;}
, where can I found the exactly explanation of this filed ? Or I what to know all about the role
user
Capabilities
, where can I get these information.
Second, how can I create new roles via wordpress's API
by code
Thanks in advanced.
5 s
The wp_capabilities saves the value as serilized array, you can try it in your php or for this example here: http://blog.tanist.co.uk/files/unserialize/.
The Code:
a:1:{s:13:"administrator";b:1;}
Is:
Array
(
[administrator] => 1
)
Meaning the user is an administrator.
You can add new roles to the database by running the function add_role, and only run it once!