post_type = apply_filters('ylt_producten_posttype',$this->post_type); $this->taxonomies['productgroepen'] = array( 'label' => __( 'Productgroepen' ), 'labels' => array( 'name' => __('Productgroepen'), 'singular_name' => __('Productgroep'), 'search_items' => __('Productgroepen zoeken'), 'popular_items' => __('Populaire Productgroepen'), 'all_items' => __('Alle Productgroepen'), 'parent_item' => __('Huidige Productgroep'), 'parent_item_colon' => __('Huidige Productgroep:'), 'edit_item' => __('Wijzig Productgroep'), 'update_item' => __('Update Productgroep'), 'add_new_item' => __('Nieuwe Productgroep toevoegen'), 'new_item_name' => __('Nieuwe Productgroep') ), 'hierarchical' => true, 'show_in_nav_menus' => true, 'slug' => 'productgroep', 'show_ui' => true ); // Filter to add/remove taxonomies. Format: ($taxonomy_name,$args) $this->taxonomies = apply_filters('ylt_producten_taxonomies',$this->taxonomies); // Register the posttype with the given name and taxonomies register_post_type( $this->post_type, array( 'label' => __('Producten'), 'labels' => array( 'name' => __('Producten'), 'singular_name' => __('Product'), 'add_new' => __('Product toevoegen'), 'add_new_item' => __('Nieuw product'), 'edit_item' => __('Wijzig product'), 'new_item' => __('Nieuw product'), 'all_items' => __('Alle producten'), 'view_item' => __('Bekijk product'), 'search_items' => __('Zoek producten'), 'not_found' => __('Er zijn geen producten gevonden'), 'not_found_in_trash' => __('Geen producten gevonden in de prullenbak') ), 'public' => true, 'can_export' => true, 'menu_position' => 57, 'show_ui' => true, '_edit_link' => 'post.php?post=%d', 'capability_type' => 'post', 'hierarchical' => true, 'has_archive' => true, 'supports' => array( 'title', 'editor', 'thumbnail', 'revisions', //'excerpt' ), 'show_in_nav_menus' => true, 'taxonomies' => array_keys($this->taxonomies) ) ); // Register all available taxonomies foreach ($this->taxonomies as $taxonomy => $taxonomy_arguments) { register_taxonomy($taxonomy,$this->post_type,$taxonomy_arguments); } } /** * @function Custom metaboxes initialisation * @dependency YLT Custom Metabox Plugin **/ function ylt_producten_meta_boxes( array $meta_boxes ) { $meta_fields = array( array( 'name' => 'Productgegevens', 'desc' => '', 'id' => 'extra_title', 'type' => 'title', ), array( 'name' => 'Volgordenummering', 'desc' => '', 'id' => 'product_order', 'type' => 'text_small', ), array( 'name' => 'Samenvatting voor overzichten', 'desc' => '', 'id' => 'product_excerpt', 'type' => 'wysiwyg', ), // array( // 'name' => 'Voorraad', // 'desc' => 'Productvoorraad', // 'id' => 'product_stock', // 'type' => 'text_small', // ), // // /** PRODUCT IMAGES **/ // // array( // 'name' => 'Afbeelding 1', // 'desc' => '', // 'id' => 'product_img_1', // 'type' => 'file', // 'save_id' => true // ), // array( // 'name' => 'Afbeelding 2', // 'desc' => '', // 'id' => 'product_img__2', // 'type' => 'file', // 'save_id' => true // ), // array( // 'name' => 'Afbeelding 3', // 'desc' => '', // 'id' => 'product_img_3', // 'type' => 'file', // 'save_id' => true // ), // array( // 'name' => 'Afbeelding 4', // 'desc' => '', // 'id' => 'product_img_4', // 'type' => 'file', // 'save_id' => true // ), // array( // 'name' => 'Afbeelding 5', // 'desc' => '', // 'id' => 'product_img_5', // 'type' => 'file', // 'save_id' => true // ), // // /** EXTRA **/ // array( // 'name' => 'Extra', // 'desc' => '', // 'id' => 'extra_title', // 'type' => 'title', // ), // array( // 'name' => 'Specificatie 1', // 'desc' => 'Product specificaties', // 'id' => 'product_spec_1', // 'type' => 'text', // ), // array( // 'name' => 'Specificatie 2', // 'desc' => 'Product specificaties', // 'id' => 'product_spec_2', // 'type' => 'text', // ), // array( // 'name' => 'Specificatie 3', // 'desc' => 'Product specificaties', // 'id' => 'product_spec_3', // 'type' => 'text', // ), // array( // 'name' => 'Specificatie 4', // 'desc' => 'Product specificaties', // 'id' => 'product_spec_4', // 'type' => 'text', // ), // array( // 'name' => 'Specificatie 5', // 'desc' => 'Product specificaties', // 'id' => 'product_spec_5', // 'type' => 'text', // ) ); // Filter to add/remove/change meta boxes $meta_fields = apply_filters('ylt_producten_meta_boxes',$meta_fields); $meta_boxes[] = array( 'id' => $this->post_type.'_metabox', 'title' => 'Product', 'pages' => array( $this->post_type ), // Change this to the postype 'context' => 'normal', 'priority' => 'high', 'show_names' => true, // Show field names on the left 'fields' => $meta_fields ); return $meta_boxes; } }