Advertisement
Guest User

Untitled

a guest
Jun 17th, 2014
373
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.73 KB | None | 0 0
  1. // register the movie custom post type
  2. add_action('init', 'cptui_register_my_cpt_movie');
  3. function cptui_register_my_cpt_movie() {
  4. register_post_type('movie', array(
  5. 'label' => 'Movies',
  6. 'description' => 'Movie listings',
  7. 'public' => true,
  8. 'show_ui' => true,
  9. 'show_in_menu' => true,
  10. 'capability_type' => 'post',
  11. 'map_meta_cap' => true,
  12. 'hierarchical' => false,
  13. 'rewrite' => array('slug' => 'movie', 'with_front' => true),
  14. 'query_var' => true,
  15. 'has_archive' => true,
  16. 'exclude_from_search' => true,
  17. 'publicly_queryable' => true,
  18. 'menu_position' => 5,
  19. 'supports' => array('title','excerpt','comments','revisions','thumbnail'),
  20. 'taxonomies' => array('actors','director','genre'),
  21. 'labels' => array (
  22. 'name' => 'Movies',
  23. 'singular_name' => 'Movie',
  24. 'menu_name' => 'Movies',
  25. 'add_new' => 'Add Movie',
  26. 'add_new_item' => 'Add New Movie',
  27. 'edit' => 'Edit',
  28. 'edit_item' => 'Edit Movie',
  29. 'new_item' => 'New Movie',
  30. 'view' => 'View Movie',
  31. 'view_item' => 'View Movie',
  32. 'search_items' => 'Search Movies',
  33. 'not_found' => 'No Movies Found',
  34. 'not_found_in_trash' => 'No Movies found in Trash',
  35. 'parent' => 'Parent Movie',
  36. )
  37. ) );
  38. }
  39.  
  40. // Register the Actor Taxonomy
  41. add_action('init', 'cptui_register_my_taxes_actors');
  42. function cptui_register_my_taxes_actors() {
  43. register_taxonomy( 'actors',array (
  44. 0 => 'movie',
  45. ),
  46. array( 'hierarchical' => false,
  47. 'label' => 'Starring',
  48. 'show_ui' => true,
  49. 'query_var' => true,
  50. 'show_admin_column' => true,
  51. 'rewrite' => array( 'slug' => 'actor' ),
  52. 'labels' => array (
  53. 'search_items' => 'Actor',
  54. 'popular_items' => 'Most Used Actors',
  55. 'all_items' => 'All Actors',
  56. 'parent_item' => 'Parent Actor',
  57. 'parent_item_colon' => 'Parent Actor:',
  58. 'edit_item' => 'Edit Actor',
  59. 'update_item' => 'Update Actor',
  60. 'add_new_item' => 'Add New Actor',
  61. 'new_item_name' => 'New Actor Name',
  62. 'separate_items_with_commas' => 'Separate actors with commas)',
  63. 'add_or_remove_items' => 'Add or remove actors',
  64. 'choose_from_most_used' => 'Choose from the most used actors',
  65. )
  66. ) );
  67. }
  68.  
  69. // Register the Directory Taxonomy
  70. add_action('init', 'cptui_register_my_taxes_director');
  71. function cptui_register_my_taxes_director() {
  72. register_taxonomy( 'director',array (
  73. 0 => 'movie',
  74. ),
  75. array( 'hierarchical' => false,
  76. 'label' => 'Directed by',
  77. 'show_ui' => true,
  78. 'query_var' => true,
  79. 'show_admin_column' => true,
  80. 'rewrite' => array( 'slug' => 'director' ),
  81. 'labels' => array (
  82. 'search_items' => 'Director',
  83. 'popular_items' => 'Most Used Directors',
  84. 'all_items' => 'All Directors',
  85. 'parent_item' => 'Parent Director',
  86. 'parent_item_colon' => 'Parent Director:',
  87. 'edit_item' => 'Edit Director',
  88. 'update_item' => 'Update Director',
  89. 'add_new_item' => 'Add New Director',
  90. 'new_item_name' => 'New Director Name',
  91. 'separate_items_with_commas' => 'Separate directors with commas',
  92. 'add_or_remove_items' => 'Add or remove directors',
  93. 'choose_from_most_used' => 'Choose from the most used directors',
  94. )
  95. ) );
  96. }
  97.  
  98. // Register the Genre Taxonomy
  99. add_action('init', 'cptui_register_my_taxes_genre');
  100. function cptui_register_my_taxes_genre() {
  101. register_taxonomy( 'genre',array (
  102. 0 => 'movie',
  103. ),
  104. array( 'hierarchical' => true,
  105. 'label' => 'Genres',
  106. 'show_ui' => true,
  107. 'query_var' => true,
  108. 'show_admin_column' => true,
  109. 'rewrite' => array( 'slug' => 'genre' ),
  110. 'labels' => array (
  111. 'search_items' => 'Genre',
  112. 'popular_items' => 'Popular Genres',
  113. 'all_items' => 'All Genres',
  114. 'parent_item' => 'Parent Genre',
  115. 'parent_item_colon' => 'Parent Genre:',
  116. 'edit_item' => 'Edit Genre',
  117. 'update_item' => 'Update Genre',
  118. 'add_new_item' => 'Add New Genre',
  119. 'new_item_name' => 'New Genre Name',
  120. 'separate_items_with_commas' => 'Separate genres with commas',
  121. 'add_or_remove_items' => 'Add or remove genres',
  122. 'choose_from_most_used' => 'Choose from the most used genres',
  123. )
  124. ) );
  125. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement