Skip to content

Instantly share code, notes, and snippets.

@ridhamdholakia
Created January 31, 2019 11:03
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ridhamdholakia/60a97e9d57a45c3833368c7578824345 to your computer and use it in GitHub Desktop.
Save ridhamdholakia/60a97e9d57a45c3833368c7578824345 to your computer and use it in GitHub Desktop.
/*==================================================== Add New User Roles ======================================== */
add_role( 'author', __( 'Author' ),
array(
'read' => false,
'edit_posts' => false,
'edit_pages' => false,
'edit_others_posts' => false,
'create_posts' => false,
'manage_categories' => false,
'publish_posts' => false,
'edit_themes' => false,
'install_plugins' => false,
'update_plugin' => false,
'update_core' => false
)
);
add_role( 'editor', __( 'Editor' ),
array(
'read' => true,
'edit_posts' => true,
'edit_pages' => true,
'edit_others_posts' => true,
'create_posts' => true,
'manage_categories' => true,
'publish_posts' => true,
'edit_themes' => false,
'install_plugins' => false,
'update_plugin' => false,
'update_core' => false
)
);
add_role('user', __(
'User'),
array(
'read' => true,
'create_posts' => false,
'edit_posts' => false,
'edit_others_posts' => false,
'publish_posts' => false,
'manage_categories' => false,
)
);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment