Posted By

javifr on 10/29/10


Tagged

wordpress admin capabilities


Versions (?)

Capabilities - Adding and removing


 / Published in: PHP
 

  1. $edit_contributor = get_role('editor');
  2.  
  3. //que no pueda borrar ningun págin
  4. $edit_contributor->remove_cap('delete_pages');
  5. //no podrá ni ver páginas que no haya publicado el
  6. $edit_contributor->remove_cap('edit_others_pages');
  7. //no podrá añadir paginas nuevas, le sale un submit for review
  8. $edit_contributor->remove_cap('publish_pages');
  9. //Sus propias páginas no las podrá borrar
  10. $edit_contributor->remove_cap('delete_published_pages');
  11.  
  12. $edit_contributor->add_cap('edit_users');
  13.  
  14. $edit_contributor->add_cap('create_users');
  15. $edit_contributor->add_cap('delete_users');
  16. $edit_contributor->add_cap('add_users');
  17. $edit_contributor->add_cap('list_users');
  18.  

Report this snippet  

You need to login to post a comment.