Skip to content

Instantly share code, notes, and snippets.

@ewistrand
Last active January 17, 2017 00:20
Show Gist options
  • Save ewistrand/13df321c5ac236e7a646 to your computer and use it in GitHub Desktop.
Save ewistrand/13df321c5ac236e7a646 to your computer and use it in GitHub Desktop.
WP Add New User Role Example
<?php
/**
* WP Add New User Role
*/
function wps_add_role() {
add_role( 'manager', 'Manager',
array(
'read' => true,
'edit_posts' => true,
'delete_posts' => true,
'edit_published_posts' => true,
'publish_posts' => true,
'edit_files' => true,
'import' => true,
'upload_files' => true
)
);
}
add_action( 'init', 'wps_add_role' );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment