Guest User

Untitled

a guest
Dec 13th, 2017
66
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.87 KB | None | 0 0
  1. if(!defined('ABSPATH'))exit;
  2.  
  3. add_action('init', 'qp_team_register_post_type');
  4. // Add custom post type and add it to the admin menu
  5. function qp_team_register_post_type() {
  6. $labels = array(
  7. 'name' => _x( 'Team', 'Post type general name', 'q2-team' ),
  8. 'singular_name' => _x( 'Team', 'Post type singular name', 'q2-team' ),
  9. 'menu_name' => _x( 'Team', 'Admin Menu text', 'q2-team' ),
  10. 'name_admin_bar' => _x( 'Team', 'Add New on Toolbar', 'q2-team' ),
  11. );
  12. $args = array(
  13. 'labels' => $labels,
  14. 'public' => true,
  15. 'publicly_queryable' => true,
  16. 'show_ui' => true,
  17. 'show_in_menu' => true,
  18. 'query_var' => true,
  19. 'rewrite' => array( 'slug' => 'team' ),
  20. 'capability_type' => 'post',
  21. 'has_archive' => true,
  22. 'hierarchical' => false,
  23. 'menu_position' => null,
  24. 'supports' => array( 'title', 'editor', 'author', 'thumbnail', 'excerpt', 'comments' ),
  25. 'menu_icon' => 'dashicons-portfolio'
  26. );
  27. register_post_type( 'qp_team', $args);
  28. }
  29.  
  30.  
  31. /* Register Taxonomy for Groups */
  32. add_action( 'init', 'team_group_taxonomies');
  33. function team_group_taxonomies() {
  34. $labels = array(
  35. 'name' => _x( 'Groep', 'sp-program-and-widget' ),
  36. 'singular_name' => _x( 'Groep', 'sp-program-and-widget' ),
  37. 'search_items' => __( 'Zoek groep', 'sp-program-and-widget' ),
  38. 'all_items' => __( 'Alle groepen', 'sp-program-and-widget' ),
  39. 'parent_item' => __( 'Parent Category', 'sp-program-and-widget' ),
  40. 'parent_item_colon' => __( 'Parent Category:', 'sp-program-and-widget' ),
  41. 'edit_item' => __( 'Groep beheren', 'sp-program-and-widget' ),
  42. 'update_item' => __( 'Groep bijwerken', 'sp-program-and-widget' ),
  43. 'add_new_item' => __( 'Nieuwe groep toevoegen', 'sp-program-and-widget' ),
  44. 'new_item_name' => __( 'Nieuwe groep naam', 'sp-program-and-widget' ),
  45. 'menu_name' => __( 'Groep', 'sp-program-and-widget' ),
  46. );
  47.  
  48. $args = array(
  49. 'hierarchical' => true,
  50. 'labels' => $labels,
  51. 'show_ui' => true,
  52. 'show_admin_column' => true,
  53. 'query_var' => true,
  54. 'rewrite' => array( 'slug' => 'team-group' ),
  55. );
  56.  
  57. register_taxonomy( 'team-group', array( 'qp_team' ), $args );
  58. }
  59.  
  60.  
  61. /* Register Taxonomy for Locations */
  62. add_action( 'init', 'team_locations_taxonomies');
  63. function team_locations_taxonomies() {
  64. $labels = array(
  65. 'name' => _x( 'Locatie', 'sp-program-and-widget' ),
  66. 'singular_name' => _x( 'Locatie', 'sp-program-and-widget' ),
  67. 'search_items' => __( 'Zoek locatie', 'sp-program-and-widget' ),
  68. 'all_items' => __( 'Alle locaties', 'sp-program-and-widget' ),
  69. 'parent_item' => __( 'Parent locatie', 'sp-program-and-widget' ),
  70. 'parent_item_colon' => __( 'Parent locatie:', 'sp-program-and-widget' ),
  71. 'edit_item' => __( 'Locatie beheren', 'sp-program-and-widget' ),
  72. 'update_item' => __( 'Locatie bijwerken', 'sp-program-and-widget' ),
  73. 'add_new_item' => __( 'Nieuwe locatie toevoegen', 'sp-program-and-widget' ),
  74. 'new_item_name' => __( 'Nieuwe locatie naam', 'sp-program-and-widget' ),
  75. 'menu_name' => __( 'Locatie', 'sp-program-and-widget' ),
  76. );
  77.  
  78. $args = array(
  79. 'hierarchical' => true,
  80. 'labels' => $labels,
  81. 'show_ui' => true,
  82. 'show_admin_column' => true,
  83. 'query_var' => true,
  84. 'rewrite' => array( 'slug' => 'team-locations' ),
  85. );
  86.  
  87. register_taxonomy( 'team-locations', array( 'qp_team' ), $args );
  88. }
  89.  
  90.  
  91. /* Register Taxonomy for Werkdagen */
  92. add_action( 'init', 'team_days_taxonomies');
  93. function team_days_taxonomies() {
  94. $labels = array(
  95. 'name' => _x( 'Werkdagen', 'sp-program-and-widget' ),
  96. 'singular_name' => _x( 'Werkdag', 'sp-program-and-widget' ),
  97. 'search_items' => __( 'Zoek werkdagen', 'sp-program-and-widget' ),
  98. 'all_items' => __( 'Alle werkdagen', 'sp-program-and-widget' ),
  99. 'parent_item' => __( 'Parent werkdag', 'sp-program-and-widget' ),
  100. 'parent_item_colon' => __( 'Parent werkdag:', 'sp-program-and-widget' ),
  101. 'edit_item' => __( 'Werkdagen beheren', 'sp-program-and-widget' ),
  102. 'update_item' => __( 'Werkdag bijwerken', 'sp-program-and-widget' ),
  103. 'add_new_item' => __( 'Nieuwe werkdag toevoegen', 'sp-program-and-widget' ),
  104. 'new_item_name' => __( 'Nieuwe werkdag naam', 'sp-program-and-widget' ),
  105. 'menu_name' => __( 'Werkdagen', 'sp-program-and-widget' ),
  106. );
  107.  
  108. $args = array(
  109. 'hierarchical' => true,
  110. 'labels' => $labels,
  111. 'show_ui' => true,
  112. 'show_admin_column' => true,
  113. 'query_var' => true,
  114. 'rewrite' => array( 'slug' => 'team-days' ),
  115. );
  116.  
  117. register_taxonomy( 'team-days', array( 'qp_team' ), $args );
  118. }
Add Comment
Please, Sign In to add comment