I was wondering if I can include a function for adding roles into my Piklist plugin file? I’m asking because when I add the new role it causes a crash. I just created a hook and then put the function in above the filter for the piklist code. I was just experimenting with a new simple role here.
//Hook to add new roles
add_action( ‘admin_init’, ‘add_custom_role’ );
//Creating the new roles
function add_custom_role() {
$designer = add_role( ‘desinger’, ‘Designer’, array(
‘read’ => true,
‘edit_posts’ => true,
‘delete_posts’ => false,
));
Doesn’t seem to work when I add it into the piklist main plugin php file. Would appreciate some help on this. Thank you!