Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- /* REGISTER POST TYPES */
- /*
- the post-types which are defined in this file are:
- (these can be active or inactive)
- - project
- - land
- - event
- - persoon
- - kennisbank
- - vacatures
- */
- function register_kncv_post_types() {
- $cpt_project = array(
- 'labels' => array(
- 'name' => 'Projecten',
- 'singular_name' => 'Project',
- 'menu_name' => 'Projecten',
- 'add_new' => 'Voeg project toe',
- 'add_new_item' => 'Voeg nieuw project toe',
- 'edit_item' => 'Edit project',
- 'new_item' => 'Nieuw project',
- 'all_items' => 'Alle projecten',
- 'view_item' => 'Bekijk project',
- 'search_items' => 'Zoek projecten',
- 'not_found' => 'Geen project(en)',
- 'not_found_in_trash' => 'Geen project(en) in trash'
- ),
- 'public' => true,
- 'exclude_from_search' => false,
- 'public_queryable' => true,
- 'show_ui' => true,
- 'show_in_menu' => true,
- 'show_in_admin_bar' => true,
- 'capability_type' => 'project',
- 'query_var' => true,
- // 'rewrite' => array( 'slug' => 'project', 'feeds' => false ),
- 'has_archive' => true,
- 'menu_position' => 30,
- 'menu_icon' => 'dashicons-portfolio',
- 'supports' => array('title', 'editor', 'thumbnail')
- );
- register_post_type( 'project', $cpt_project );
- $cpt_country = array(
- 'labels' => array(
- 'name' => 'Landen',
- 'singular_name' => 'Land',
- 'menu_name' => 'Landen',
- 'add_new' => 'Voeg land toe',
- 'add_new_item' => 'Voeg nieuw land toe',
- 'edit_item' => 'Edit land',
- 'new_item' => 'Nieuw land',
- 'all_items' => 'Alle landen',
- 'view_item' => 'Bekijk land',
- 'search_items' => 'Zoek landen',
- 'not_found' => 'Geen landen',
- 'not_found_in_trash' => 'Geen landen in trash'
- ),
- 'public' => true,
- 'exclude_from_search' => false,
- 'public_queryable' => true,
- 'show_ui' => true,
- 'show_in_menu' => true,
- 'show_in_admin_bar' => true,
- 'capability_type' => 'gebied',
- 'query_var' => true,
- 'rewrite' => array( 'slug' => 'land', 'feeds' => false ),
- 'has_archive' => true,
- 'menu_position' => 30,
- 'menu_icon' => 'dashicons-admin-site',
- 'supports' => array('title', 'editor', 'thumbnail')
- );
- register_post_type( 'land', $cpt_country );
- $cpt_event = array(
- 'labels' => array(
- 'name' => 'Event',
- 'singular_name' => 'Events',
- 'menu_name' => 'Events',
- 'add_new' => 'Voeg event toe',
- 'add_new_item' => 'Voeg nieuw event toe',
- 'edit_item' => 'Edit event',
- 'new_item' => 'Nieuw event',
- 'all_items' => 'Alle events',
- 'view_item' => 'Bekijk event',
- 'search_items' => 'Zoek events',
- 'not_found' => 'Geen events',
- 'not_found_in_trash' => 'Geen events in trash'
- ),
- 'public' => true,
- 'exclude_from_search' => false,
- 'public_queryable' => true,
- 'show_ui' => true,
- 'show_in_menu' => true,
- 'show_in_admin_bar' => true,
- 'capability_type' => 'event',
- 'query_var' => true,
- // 'rewrite' => array( 'slug' => 'event', 'feeds' => false ),
- 'has_archive' => true,
- 'menu_position' => 30,
- 'menu_icon' => 'dashicons-megaphone',
- 'supports' => array('title', 'editor', 'thumbnail')
- );
- register_post_type( 'event', $cpt_event );
- $cpt_people = array(
- 'labels' => array(
- 'name' => 'People',
- 'singular_name' => 'Persoon', 'kncv',
- 'menu_name' => 'People',
- 'add_new' => 'Voeg een persoon toe',
- 'add_new_item' => 'Voeg nieuw persoon toe',
- 'edit_item' => 'Edit persoon',
- 'new_item' => 'Nieuw persoon',
- 'all_items' => 'Alle personen',
- 'view_item' => 'Bekijk persoon',
- 'search_items' => 'Zoek personen',
- 'not_found' => 'Geen personen',
- 'not_found_in_trash' => 'Geen personen in trash'
- ),
- 'public' => true,
- 'exclude_from_search' => false,
- 'public_queryable' => true,
- 'show_ui' => true,
- 'show_in_menu' => true,
- 'show_in_admin_bar' => true,
- 'capability_type' => 'person',
- 'query_var' => true,
- 'rewrite' => array( 'slug' => 'person', 'feeds' => false ),
- 'has_archive' => true,
- 'menu_position' => 30,
- 'menu_icon' => 'dashicons-universal-access-alt',
- 'supports' => array('title', 'editor', 'thumbnail')
- );
- register_post_type( 'people', $cpt_people );
- $cpt_kennisbank = array(
- 'labels' => array(
- 'name' => 'Kennisbank',
- 'singular_name' => 'Kennisbank',
- 'menu_name' => 'Kennisbank',
- 'add_new' => 'Voeg topic toe',
- 'add_new_item' => 'Voeg nieuw topic toe',
- 'edit_item' => 'Edit topic',
- 'new_item' => 'Nieuw topic',
- 'all_items' => 'Alle topics',
- 'view_item' => 'Bekijk topic',
- 'search_items' => 'Zoek topics',
- 'not_found' => 'Geen topics',
- 'not_found_in_trash' => 'Geen topics in trash'
- ),
- 'public' => true,
- 'exclude_from_search' => false,
- 'public_queryable' => true,
- 'show_ui' => true,
- 'show_in_menu' => true,
- 'show_in_admin_bar' => true,
- 'capability_type' => 'kb',
- 'capabilities' => array(
- 'edit_post' => 'edit_kb',
- 'read_post' => 'read_kb',
- 'delete_post' => 'delete_kb',
- 'delete_posts' => 'delete_kbs',
- 'edit_posts' => 'edit_kbs',
- 'edit_others_posts' => 'edit_others_kbs',
- 'publish_posts' => 'publish_kbs',
- 'read_private_posts' => 'read_private_kbs',
- 'create_posts' => 'edit_kbs',
- ),
- 'query_var' => true,
- // 'rewrite' => array( 'slug' => 'kb', 'feeds' => false ),
- 'has_archive' => true,
- 'menu_position' => 30,
- 'menu_icon' => 'dashicons-editor-help',
- 'supports' => array('title', 'editor', 'thumbnail'),
- // 'taxonomies' => array('post_tag')
- );
- register_post_type( 'kb', $cpt_kennisbank );
- $cpt_vacancy = array(
- 'labels' => array(
- 'name' => 'Vacancies',
- 'singular_name' => 'Vacancy',
- 'menu_name' => 'Vacatures',
- 'add_new' => 'Voeg vacature toe',
- 'add_new_item' => 'Voeg nieuwe vacature toe',
- 'edit_item' => 'Edit vacature',
- 'new_item' => 'Nieuwe vacature',
- 'all_items' => 'Alle vacatures',
- 'view_item' => 'Bekijk vacature',
- 'search_items' => 'Zoek vacatures',
- 'not_found' => 'Geen vacatures',
- 'not_found_in_trash' => 'Geen vacatures in trash'
- ),
- 'public' => true,
- 'exclude_from_search' => false,
- 'public_queryable' => true,
- 'show_ui' => true,
- 'show_in_menu' => true,
- 'show_in_admin_bar' => true,
- 'capability_type' => 'vacature',
- 'query_var' => true,
- // 'rewrite' => array( 'slug' => 'vacancy', 'feeds' => false ),
- 'has_archive' => true,
- 'menu_position' => 30,
- 'hierarchical' => false,
- 'menu_icon' => 'dashicons-clipboard',
- 'supports' => array('title', 'editor', 'thumbnail')
- );
- register_post_type( 'vacancy', $cpt_vacancy );
- $cpt_partners = array(
- 'labels' => array(
- 'name' => 'Partners',
- 'singular_name' => 'Partner',
- 'menu_name' => 'Partners',
- 'add_new' => 'Voeg partners toe',
- 'add_new_item' => 'Voeg nieuwe partners toe',
- 'edit_item' => 'Edit partners',
- 'new_item' => 'Nieuwe partners',
- 'all_items' => 'Alle partners',
- 'view_item' => 'Bekijk partners',
- 'search_items' => 'Zoek partners',
- 'not_found' => 'Geen partners',
- 'not_found_in_trash' => 'Geen partners in trash'
- ),
- 'public' => true,
- 'exclude_from_search' => false,
- 'public_queryable' => true,
- 'show_ui' => true,
- 'show_in_menu' => true,
- 'show_in_admin_bar' => true,
- 'capability_type' => 'partner',
- 'query_var' => true,
- // 'rewrite' => array( 'slug' => 'partner', 'feeds' => false ),
- 'has_archive' => true,
- 'menu_position' => 30,
- 'menu_icon' => 'dashicons-admin-site',
- 'supports' => array('title', 'editor', 'thumbnail')
- );
- register_post_type( 'partner', $cpt_partners );
- }
- add_action( 'init', 'register_kncv_post_types' );
- function register_kncv_post_tax() {
- // add soort to kb
- $soort_tax = array(
- 'labels' => array(
- 'name' => 'Soort document',
- 'singular_name' => 'Soort',
- 'menu_name' => 'Soort document',
- 'all_items' => 'Alle soorten',
- 'edit_item' => 'Edit soort',
- 'view_item' => 'Bekijk soort',
- 'update_item' => 'Update soort',
- 'add_new_item' => 'Nieuwe soort',
- 'new_item_name' => 'Nieuwe soort',
- 'search_items' => 'Zoek soort',
- 'popular_items' => 'Populaire soorten',
- 'not_found' => 'Geen soorten',
- 'not_found_in_trash' => 'Geen soorten in trash'
- ),
- 'public' => true,
- 'show_ui' => true,
- 'show_in_nav_menus' => false, // defaults to public
- 'show_in_quick_edit' => true, // defaults to show_ui
- 'show_admin_column' => true, // defaults to false
- 'hierarchical' => true, // defaults to false
- // 'update_count_callback' => '',
- 'query_var' => 'soort',
- 'rewrite' => array( 'slug' => 'soort', 'hierarchical' => true )
- );
- register_taxonomy( 'soort', 'kb', $soort_tax );
- // add thema to kb
- $thema_tax = array(
- 'labels' => array(
- 'name' => 'Thema\'s',
- 'singular_name' => 'Thema',
- 'menu_name' => 'Thema\'s',
- 'all_items' => 'Alle thema\'s',
- 'edit_item' => 'Edit thema',
- 'view_item' => 'Bekijk thema',
- 'update_item' => 'Update thema',
- 'add_new_item' => 'Nieuwe thema',
- 'new_item_name' => 'Nieuwe thema',
- 'search_items' => 'Zoek thema',
- 'popular_items' => 'Populaire thema\'s',
- 'not_found' => 'Geen thema\'s',
- 'not_found_in_trash' => 'Geen thema\'s in trash'
- ),
- 'public' => true,
- 'show_ui' => true,
- 'show_in_nav_menus' => false, // defaults to public
- 'show_in_quick_edit' => false, // defaults to show_ui
- 'show_admin_column' => true, // defaults to false
- // 'hierarchical' => true, // defaults to false
- // 'update_count_callback' => '',
- 'query_var' => 'thema',
- 'rewrite' => array( 'slug' => 'thema', 'hierarchical' => true )
- );
- register_taxonomy( 'thema', 'kb', $thema_tax );
- // add thema to kb
- $country_tax = array(
- 'labels' => array(
- 'name' => 'Land',
- 'singular_name' => 'Land',
- 'menu_name' => 'Landen',
- 'all_items' => 'Alle landen',
- 'edit_item' => 'Edit land',
- 'view_item' => 'Bekijk land',
- 'update_item' => 'Update land',
- 'add_new_item' => 'Nieuw land',
- 'new_item_name' => 'Nieuw land',
- 'search_items' => 'Zoek land',
- 'popular_items' => 'Populaire landen',
- 'not_found' => 'Geen landen',
- 'not_found_in_trash' => 'Geen landen in trash'
- ),
- 'public' => true,
- 'show_ui' => true,
- 'show_in_nav_menus' => false, // defaults to public
- 'show_in_quick_edit' => false, // defaults to show_ui
- 'show_admin_column' => true, // defaults to false
- // 'hierarchical' => true, // defaults to false
- // 'update_count_callback' => '',
- 'query_var' => 'country',
- 'rewrite' => array( 'slug' => 'country', 'hierarchical' => true )
- );
- register_taxonomy( 'country', 'vacancy', $country_tax );
- }
- add_action( 'init', 'register_kncv_post_tax' );
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement