Advertisement
Guest User

Untitled

a guest
May 28th, 2017
50
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.93 KB | None | 0 0
  1. /**
  2. *  The following roles and capabilities code has been removed because it does not work. If you can help with this, please do.
  3. */
  4.  
  5. global $wp_roles;
  6.  
  7. if ( ! isset($wp_roles) )
  8.     $wp_roles = new WP_Roles();
  9.  
  10. if ( ! get_role('wiki_editor')){
  11.     $role_capabilities = array('read'=>true
  12.     ,'edit_posts'=>true
  13.     ,'edit_others_posts'=>true
  14.     ,'edit_published_posts'=>true
  15. //  ,'delete_posts'=>true
  16. //  ,'delete_published_posts'=>true
  17. //  ,'publish_posts'=>true
  18. //  ,'publish_pages'=>true
  19. //  ,'delete_pages'=>true
  20. //  ,'edit_pages'=>true
  21. //  ,'edit_others_pages'=>true
  22. //  ,'edit_published_pages'=>true
  23. //  ,'delete_published_pages'=>true
  24.     ,'edit_wiki'=>true);
  25.     $wp_roles->add_role('wiki_editor', 'Wiki Editor',$role_capabilities);
  26. }
  27.  
  28.  
  29. $role = get_role('wiki_editor');
  30. $role->add_cap('edit_wiki');
  31. $role->add_cap('edit_pages');
  32. $role->add_cap('edit_post');
  33. $role->add_cap('edit_others_posts');
  34. $role->add_cap('edit_published_posts');
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement