Wordpress
allows visitors to register on your website, but they offer you some default users with access to certain things, I as administrator of my site, can I create a custom user? Let me decide who has access and who does not.
Wordpress
allows visitors to register on your website, but they offer you some default users with access to certain things, I as administrator of my site, can I create a custom user? Let me decide who has access and who does not.
Of course you can do it, to manage roles and capabilities in wordpress, you can try using the following functions:
add_role():
Allows you to add a customized role. remove_role():
Remove a role. get_role ():
Get information about the role and capabilities
associated with it. For example to create a new role you could do something like this:
$result = add_role( 'client', __('Client' ),
array(
'read' => true, // true activa la capacidad, false la desactiva.
'edit_posts' => true, // Permite al usuario editar sus propios posts
'edit_pages' => true, // Permite al usuario editar páginas
'edit_others_posts' => true, // Permite al usuario editar otros post no solos los suyos.
'create_posts' => true, // Permite al usuario crear posts
'manage_categories' => true, // Permite al usuario manejar categorias
'edit_themes' => false, // El usuario no puede editar el tema
'install_plugins' => false, // El usuario no puede instalar nuevos pluggins
'update_plugin' => false, // El usuario no puede actualizar plugins
'update_core' => false // El usuario no puede realizar updates del core
)
);
I hope it serves you.