Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function addTaxonomies() {
- $labels = array(
- 'name' => __("Product types", MBRSHP_NAME),
- 'singular_name' => __("Product type", MBRSHP_NAME),
- 'add_new' => __("Add New", MBRSHP_NAME),
- 'add_new_item' => __("Add New Product type", MBRSHP_NAME),
- 'edit_item' => __("Edit Product type", MBRSHP_NAME),
- 'new_item' => __("New Product type", MBRSHP_NAME),
- 'all_items' => __("All Product types", MBRSHP_NAME),
- 'view_item' => __("View Product type", MBRSHP_NAME),
- 'search_items' => __("Search Product types", MBRSHP_NAME),
- 'not_found' => __("No Product types found", MBRSHP_NAME),
- 'not_found_in_trash' => __("No Product types found in Trash", MBRSHP_NAME),
- 'menu_name' => __("Product types", MBRSHP_NAME));
- $args = array(
- 'labels' => $labels,
- 'public' => true,
- 'show_tagcloud' => false,
- 'hierarchical' => false,
- 'capabilities' => array(
- 'manage_terms' => 'manage_types',
- 'edit_terms' => 'manage_types',
- 'delete_terms' => 'manage_types',
- 'assign_terms' => 'manage_types'));
- register_taxonomy("product_type", array("product"), $args);
- $labels = array(
- 'name' => __("Product categories", MBRSHP_NAME),
- 'singular_name' => __("Product category", MBRSHP_NAME),
- 'add_new' => __("Add New", MBRSHP_NAME),
- 'add_new_item' => __("Add New Product category", MBRSHP_NAME),
- 'edit_item' => __("Edit Product category", MBRSHP_NAME),
- 'new_item' => __("New Product category", MBRSHP_NAME),
- 'all_items' => __("All Product category", MBRSHP_NAME),
- 'view_item' => __("View Product category", MBRSHP_NAME),
- 'search_items' => __("Search Product categories", MBRSHP_NAME),
- 'not_found' => __("No Product categories found", MBRSHP_NAME),
- 'not_found_in_trash' => __("No Product categories found in Trash", MBRSHP_NAME),
- 'menu_name' => __("Product categories", MBRSHP_NAME));
- $args = array(
- 'labels' => $labels,
- 'public' => true,
- 'show_tagcloud' => false,
- 'hierarchical' => true,
- 'capabilities' => array(
- 'manage_terms' => 'manage_categories',
- 'edit_terms' => 'manage_categories',
- 'delete_terms' => 'manage_categories',
- 'assign_terms' => 'manage_categories'));
- register_taxonomy("product_cat", array("product"), $args);
- $labels = array(
- 'name' => __("Product tags", MBRSHP_NAME),
- 'singular_name' => __("Product tag", MBRSHP_NAME),
- 'add_new' => __("Add New", MBRSHP_NAME),
- 'add_new_item' => __("Add New Product tag", MBRSHP_NAME),
- 'edit_item' => __("Edit Product tag", MBRSHP_NAME),
- 'new_item' => __("New Product tag", MBRSHP_NAME),
- 'all_items' => __("All Product tags", MBRSHP_NAME),
- 'view_item' => __("View Product tag", MBRSHP_NAME),
- 'search_items' => __("Search Product tag", MBRSHP_NAME),
- 'not_found' => __("No Product tags found", MBRSHP_NAME),
- 'not_found_in_trash' => __("No Product tags found in Trash", MBRSHP_NAME),
- 'menu_name' => __("Product tags", MBRSHP_NAME));
- $args = array(
- 'labels' => $labels,
- 'public' => true,
- 'show_tagcloud' => false,
- 'hierarchical' => false,
- 'capabilities' => array(
- 'manage_terms' => 'manage_tags',
- 'edit_terms' => 'manage_tags',
- 'delete_terms' => 'manage_tags',
- 'assign_terms' => 'manage_tags'));
- register_taxonomy("product_tag", array("product"), $args);
- }
- function addPostTypes() {
- $labels = array(
- 'name' => __("Products", MBRSHP_NAME),
- 'singular_name' => __("Product", MBRSHP_NAME),
- 'add_new' => __("Add New", MBRSHP_NAME),
- 'add_new_item' => __("Add New Product", MBRSHP_NAME),
- 'edit_item' => __("Edit Product", MBRSHP_NAME),
- 'new_item' => __("New Product", MBRSHP_NAME),
- 'all_items' => __("All Products", MBRSHP_NAME),
- 'view_item' => __("View Product", MBRSHP_NAME),
- 'search_items' => __("Search Product", MBRSHP_NAME),
- 'not_found' => __("No Products found", MBRSHP_NAME),
- 'not_found_in_trash' => __("No Products found in Trash", MBRSHP_NAME),
- 'menu_name' => __("Product", MBRSHP_NAME));
- $args = array(
- 'labels' => $labels,
- 'description' => __("Sellable Products", MBRSHP_NAME),
- 'public' => true,
- 'show_ui' => true,
- 'menu_position' => 30, // Below comments
- 'menu_icon' => "/assets/img/cart.png",
- 'capability_type' => 'post',
- 'supports' => array("title",
- "editor",
- "excerpt",
- "thumbnail",
- "comments",
- "custom-fields",
- "page-attributes"),
- 'has_archive' => true,
- 'rewrite' => true);
- register_post_type("product", $args);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement