1. $capabilities = array(
  2. 'publish_posts' => 'publish_dictionary_entry',
  3. 'edit_posts' => 'edit_dictionary_entry',
  4. 'edit_others_posts' => 'edit_others_dictionary_entry',
  5. 'delete_posts' => 'delete_dictionary_entry',
  6. 'delete_others_posts' => 'delete_others_dictionary_entry',
  7. 'read_private_posts' => 'read_private_dictionary_entry',
  8. 'edit_post' => 'edit_dictionary_entry',
  9. 'delete_post' => 'delete_dictionary_entry',
  10. 'read_post' => 'read_dictionary_entry'
  11. );
  12.  
  13. register_post_type('dictionary_entry', array( 'label' => 'Dictionary Entries','description' => '','public' => true,'show_ui' => true,'show_in_menu' => true,'capability_type' => 'post','hierarchical' => false,'rewrite' => array('slug' => ''),'query_var' => true,'supports' => array('title','comments','revisions','thumbnail','author','page-attributes',),'labels' => array (
  14. 'name' => 'Dictionary Entries',
  15. 'singular_name' => 'Dictionary Entry',
  16. 'menu_name' => 'Dictionary Entries',
  17. 'add_new' => 'Add New',
  18. 'add_new_item' => 'Add New Dictionary Entry',
  19. 'edit' => 'Edit',
  20. 'edit_item' => 'Edit Dictionary Entry',
  21. 'new_item' => 'New Dictionary Entry',
  22. 'view' => 'View Dictionary Entry',
  23. 'view_item' => 'View Dictionary Entry',
  24. 'search_items' => 'Search Dictionary Entries',
  25. 'not_found' => 'No Dictionary Entries Found',
  26. 'not_found_in_trash' => 'No Dictionary Entries Found in Trash',
  27. 'parent' => 'Parent Dictionary Entry',
  28. 'capabilities' => $capabilities,
  29. ),) );
  30.  
  31. /********************** CUSTOM ROLE *****************************/
  32. add_role('dictionary_entry_author', 'Dictionary Helper', array(
  33. 'publish_dictionary_entry' => true,
  34. 'edit_dictionary_entry' => true,
  35. 'edit_others_dictionary_entry' => true,
  36. 'delete_dictionary_entry' => true,
  37. 'delete_others_dictionary_entry' => true,
  38. 'read_private_dictionary_entry' => true,
  39. 'edit_dictionary_entry' => true,
  40. 'delete_dictionary_entry' => true,
  41. 'read_dictionary_entry' => true,
  42. // more standard capabilities here
  43. ));
  44.  
  45.