Advertisement
Guest User

Untitled

a guest
Oct 30th, 2014
136
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.17 KB | None | 0 0
  1. add_action('init', 'register_projects_post_type' );
  2. add_action( 'init', 'create_projects_taxonomy', 0 );
  3.  
  4. function register_projects_post_type(){
  5. register_post_type( 'sp_project', array(
  6. 'labels' => array(
  7. 'name' => __( 'Projects' ),
  8. 'singular_name' => __( 'Project' ),
  9. 'add_new' => __( 'Add Project' ),
  10. 'add_new_item' => __( 'Add Project' ),
  11. 'edit' => __( 'Edit' ),
  12. 'edit_item' => __( 'Edit Project' ),
  13. 'new_item' => __( 'New Project' ),
  14. 'view' => __( 'View project' ),
  15. 'view_item' => __( 'View project' ),
  16. 'search_items' => __( 'Search Projects' ),
  17. 'not_found' => __( 'No project found' ),
  18. 'parent_item_colon' => __('Client'),
  19. 'parent' => __('Client')
  20. ),
  21. 'hierarchical' => true,
  22. 'public' => true,
  23. 'menu_position' => 7,
  24. 'has_archive' => true,
  25. 'query_var' => true,
  26. 'rewrite' => array('slug' => 'projects', 'with_front' => false),
  27. 'supports' => array( 'title', 'editor','thumbnail', 'custom-fields', 'excerpt', 'page-attributes', 'revisions'),
  28. 'description' => "Use this to add a new project."
  29. )
  30. );
  31. }
  32.  
  33. function create_projects_taxonomy(){
  34. $labels = array(
  35. 'name' => _x( 'Types', 'taxonomy general name' ),
  36. 'singular_name' => _x( 'Type', 'taxonomy singular name' ),
  37. 'search_items' => __( 'Search Types' ),
  38. 'all_items' => __( 'All Types' ),
  39. 'parent_item' => null,
  40. 'parent_item_colon' => null,
  41. 'edit_item' => __( 'Edit Type' ),
  42. 'update_item' => __( 'Update Type' ),
  43. 'add_new_item' => __( 'Add New Type' ),
  44. 'new_item_name' => __( 'New Type Name' ),
  45. 'separate_items_with_commas' => __( 'Separate types with commas' ),
  46. 'choose_from_most_used' => __('Choose from common types'),
  47. 'menu_name' => __( 'Project types' ),
  48. 'parent' => __('Client'),
  49. 'parent_item_colon' => __('Client')
  50. );
  51.  
  52. register_taxonomy('clients','sp_project', array(
  53. 'hierarchical' => true,
  54. 'labels' => $labels,
  55. 'show_ui' => true,
  56. 'query_var' => true,
  57. 'update_count_callback' => '_update_post_term_count',
  58. 'rewrite' => false /*array( 'slug' => 'projects' )*/
  59. ));
  60. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement