populate_roles_210

Create and modify WordPress roles for WordPress 2.1.

Description

populate_roles_210(); 

Usage

  1. if ( !function_exists( 'populate_roles_210' ) ) { 
  2. require_once ABSPATH . '/wp-admin/includes/schema.php'; 
  3.  
  4.  
  5. // NOTICE! Understand what this does before running. 
  6. $result = populate_roles_210(); 
  7.  

Defined (1)

The function is defined in the following location(s).

/wp-admin/includes/schema.php  
  1. function populate_roles_210() { 
  2. $roles = array('administrator', 'editor'); 
  3. foreach ($roles as $role) { 
  4. $role = get_role($role); 
  5. if ( empty($role) ) 
  6. continue; 
  7.  
  8. $role->add_cap('edit_others_pages'); 
  9. $role->add_cap('edit_published_pages'); 
  10. $role->add_cap('publish_pages'); 
  11. $role->add_cap('delete_pages'); 
  12. $role->add_cap('delete_others_pages'); 
  13. $role->add_cap('delete_published_pages'); 
  14. $role->add_cap('delete_posts'); 
  15. $role->add_cap('delete_others_posts'); 
  16. $role->add_cap('delete_published_posts'); 
  17. $role->add_cap('delete_private_posts'); 
  18. $role->add_cap('edit_private_posts'); 
  19. $role->add_cap('read_private_posts'); 
  20. $role->add_cap('delete_private_pages'); 
  21. $role->add_cap('edit_private_pages'); 
  22. $role->add_cap('read_private_pages'); 
  23.  
  24. $role = get_role('administrator'); 
  25. if ( ! empty($role) ) { 
  26. $role->add_cap('delete_users'); 
  27. $role->add_cap('create_users'); 
  28.  
  29. $role = get_role('author'); 
  30. if ( ! empty($role) ) { 
  31. $role->add_cap('delete_posts'); 
  32. $role->add_cap('delete_published_posts'); 
  33.  
  34. $role = get_role('contributor'); 
  35. if ( ! empty($role) ) { 
  36. $role->add_cap('delete_posts');