Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- if(!defined('ABSPATH'))exit;
- add_action('init', 'qp_team_register_post_type');
- // Add custom post type and add it to the admin menu
- function qp_team_register_post_type() {
- $labels = array(
- 'name' => _x( 'Team', 'Post type general name', 'q2-team' ),
- 'singular_name' => _x( 'Team', 'Post type singular name', 'q2-team' ),
- 'menu_name' => _x( 'Team', 'Admin Menu text', 'q2-team' ),
- 'name_admin_bar' => _x( 'Team', 'Add New on Toolbar', 'q2-team' ),
- );
- $args = array(
- 'labels' => $labels,
- 'public' => true,
- 'publicly_queryable' => true,
- 'show_ui' => true,
- 'show_in_menu' => true,
- 'query_var' => true,
- 'rewrite' => array( 'slug' => 'team' ),
- 'capability_type' => 'post',
- 'has_archive' => true,
- 'hierarchical' => false,
- 'menu_position' => null,
- 'supports' => array( 'title', 'editor', 'author', 'thumbnail', 'excerpt', 'comments' ),
- 'menu_icon' => 'dashicons-portfolio'
- );
- register_post_type( 'qp_team', $args);
- }
- /* Register Taxonomy for Groups */
- add_action( 'init', 'team_group_taxonomies');
- function team_group_taxonomies() {
- $labels = array(
- 'name' => _x( 'Groep', 'sp-program-and-widget' ),
- 'singular_name' => _x( 'Groep', 'sp-program-and-widget' ),
- 'search_items' => __( 'Zoek groep', 'sp-program-and-widget' ),
- 'all_items' => __( 'Alle groepen', 'sp-program-and-widget' ),
- 'parent_item' => __( 'Parent Category', 'sp-program-and-widget' ),
- 'parent_item_colon' => __( 'Parent Category:', 'sp-program-and-widget' ),
- 'edit_item' => __( 'Groep beheren', 'sp-program-and-widget' ),
- 'update_item' => __( 'Groep bijwerken', 'sp-program-and-widget' ),
- 'add_new_item' => __( 'Nieuwe groep toevoegen', 'sp-program-and-widget' ),
- 'new_item_name' => __( 'Nieuwe groep naam', 'sp-program-and-widget' ),
- 'menu_name' => __( 'Groep', 'sp-program-and-widget' ),
- );
- $args = array(
- 'hierarchical' => true,
- 'labels' => $labels,
- 'show_ui' => true,
- 'show_admin_column' => true,
- 'query_var' => true,
- 'rewrite' => array( 'slug' => 'team-group' ),
- );
- register_taxonomy( 'team-group', array( 'qp_team' ), $args );
- }
- /* Register Taxonomy for Locations */
- add_action( 'init', 'team_locations_taxonomies');
- function team_locations_taxonomies() {
- $labels = array(
- 'name' => _x( 'Locatie', 'sp-program-and-widget' ),
- 'singular_name' => _x( 'Locatie', 'sp-program-and-widget' ),
- 'search_items' => __( 'Zoek locatie', 'sp-program-and-widget' ),
- 'all_items' => __( 'Alle locaties', 'sp-program-and-widget' ),
- 'parent_item' => __( 'Parent locatie', 'sp-program-and-widget' ),
- 'parent_item_colon' => __( 'Parent locatie:', 'sp-program-and-widget' ),
- 'edit_item' => __( 'Locatie beheren', 'sp-program-and-widget' ),
- 'update_item' => __( 'Locatie bijwerken', 'sp-program-and-widget' ),
- 'add_new_item' => __( 'Nieuwe locatie toevoegen', 'sp-program-and-widget' ),
- 'new_item_name' => __( 'Nieuwe locatie naam', 'sp-program-and-widget' ),
- 'menu_name' => __( 'Locatie', 'sp-program-and-widget' ),
- );
- $args = array(
- 'hierarchical' => true,
- 'labels' => $labels,
- 'show_ui' => true,
- 'show_admin_column' => true,
- 'query_var' => true,
- 'rewrite' => array( 'slug' => 'team-locations' ),
- );
- register_taxonomy( 'team-locations', array( 'qp_team' ), $args );
- }
- /* Register Taxonomy for Werkdagen */
- add_action( 'init', 'team_days_taxonomies');
- function team_days_taxonomies() {
- $labels = array(
- 'name' => _x( 'Werkdagen', 'sp-program-and-widget' ),
- 'singular_name' => _x( 'Werkdag', 'sp-program-and-widget' ),
- 'search_items' => __( 'Zoek werkdagen', 'sp-program-and-widget' ),
- 'all_items' => __( 'Alle werkdagen', 'sp-program-and-widget' ),
- 'parent_item' => __( 'Parent werkdag', 'sp-program-and-widget' ),
- 'parent_item_colon' => __( 'Parent werkdag:', 'sp-program-and-widget' ),
- 'edit_item' => __( 'Werkdagen beheren', 'sp-program-and-widget' ),
- 'update_item' => __( 'Werkdag bijwerken', 'sp-program-and-widget' ),
- 'add_new_item' => __( 'Nieuwe werkdag toevoegen', 'sp-program-and-widget' ),
- 'new_item_name' => __( 'Nieuwe werkdag naam', 'sp-program-and-widget' ),
- 'menu_name' => __( 'Werkdagen', 'sp-program-and-widget' ),
- );
- $args = array(
- 'hierarchical' => true,
- 'labels' => $labels,
- 'show_ui' => true,
- 'show_admin_column' => true,
- 'query_var' => true,
- 'rewrite' => array( 'slug' => 'team-days' ),
- );
- register_taxonomy( 'team-days', array( 'qp_team' ), $args );
- }
Add Comment
Please, Sign In to add comment