Agregar nuevo rol de usuario y establecer sus permisos

Agregar al archivo “functions.php” del template actual:

[codesyntax lang=”php”]

// Add a custom user role
$result = add_role( 'client', __('Client' ),
array(
'read' => true, // true allows this capability
'edit_posts' => true, // Allows user to edit their own posts
'edit_pages' => true, // Allows user to edit pages
'edit_others_posts' => true, // Allows user to edit others posts not just their own
'create_posts' => true, // Allows user to create new posts
'manage_categories' => true, // Allows user to manage post categories
'publish_posts' => true, // Allows the user to publish, otherwise posts stays in draft mode
'edit_themes' => false, // false denies this capability. User can’t edit your theme
'install_plugins' => false, // User cant add new plugins
'update_plugin' => false, // User can’t update any plugins
'update_core' => false // user cant perform core updates
)
);

[/codesyntax]

Para establecer los permisos del nuevo rol debemos instalar el plugin:
WP Customer Area
https://wordpress.org/plugins/customer-area/

Este plugin contiene los siguientes add-ons internos:

  • Administration Area
  • Capabilities Manager
  • Container Owner
  • Customer Page – Account – Details
  • Customer Page – Account – Edit
  • Customer Page – Account – Home
  • Customer Page – Inicio
  • Customer Page – Inicio
  • Customer Page – Logout
  • Customer Page – Private Files – Home
  • Customer Page – Private Files – Owned
  • Customer Page – Private Pages – Home
  • Customer Page – Private Pages – Owned
  • Customer Pages
  • Estado
  • Installer
  • Log
  • Post Owner
  • Private Files
  • Private Pages
  • Shortcodes
  • User Profile
Senior Web Developer / System Administrator
PHP Consultant at Universidad Autónoma de Nuevo León
http://www.linkedin.com/in/leninmezazarco