Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Products Section
- function all_procucts_custom() {
- $labels = array(
- 'name' => _x( 'Products', 'Post Type General Name', 'text_domain' ),
- 'singular_name' => _x( 'Product', 'Post Type Singular Name', 'text_domain' ),
- 'menu_name' => __( 'Products', 'text_domain' ),
- 'parent_item_colon' => __( 'Parent Item:', 'text_domain' ),
- 'all_items' => __( 'All Products', 'text_domain' ),
- 'view_item' => __( 'View Product', 'text_domain' ),
- 'add_new_item' => __( 'Add New Product', 'text_domain' ),
- 'add_new' => __( 'Add New Product', 'text_domain' ),
- 'edit_item' => __( 'Edit Product', 'text_domain' ),
- 'update_item' => __( 'Update Product', 'text_domain' ),
- 'search_items' => __( 'Search Product', 'text_domain' ),
- 'not_found' => __( 'Not found', 'text_domain' ),
- 'not_found_in_trash' => __( 'Not found in Trash', 'text_domain' ),
- );
- $args = array(
- 'label' => __( 'all_products', 'text_domain' ),
- 'description' => __( 'All Products', 'text_domain' ),
- 'labels' => $labels,
- 'supports' => array( 'title', 'thumbnail', ),
- 'taxonomies' => array( 'product-cat', 'app' ),
- 'hierarchical' => false,
- 'public' => true,
- 'rewrite' => array('slug' => 'products', 'with_front' => false),
- 'show_ui' => true,
- 'show_in_menu' => true,
- 'show_in_nav_menus' => true,
- 'show_in_admin_bar' => true,
- 'menu_position' => 5,
- 'menu_icon' => 'dashicons-forms',
- 'can_export' => true,
- 'has_archive' => true,
- 'exclude_from_search' => false,
- 'publicly_queryable' => true,
- 'capability_type' => 'page',
- );
- register_post_type( 'all_products', $args );
- }
- add_action( 'init', 'all_procucts_custom', 0 );
- //Taxonomy for Products --Categories
- function taxonomy_for_products_cat() {
- $labels = array(
- 'name' => _x( 'Categories', 'Taxonomy General Name', 'text_domain' ),
- 'singular_name' => _x( 'Category', 'Taxonomy Singular Name', 'text_domain' ),
- 'menu_name' => __( 'Products Categories', 'text_domain' ),
- 'all_items' => __( 'All Items', 'text_domain' ),
- 'parent_item' => __( 'Parent Item', 'text_domain' ),
- 'parent_item_colon' => __( 'Parent Item:', 'text_domain' ),
- 'new_item_name' => __( 'New Item Name', 'text_domain' ),
- 'add_new_item' => __( 'Add New Item', 'text_domain' ),
- 'edit_item' => __( 'Edit Item', 'text_domain' ),
- 'update_item' => __( 'Update Item', 'text_domain' ),
- 'separate_items_with_commas' => __( 'Separate items with commas', 'text_domain' ),
- 'search_items' => __( 'Search Items', 'text_domain' ),
- 'add_or_remove_items' => __( 'Add or remove items', 'text_domain' ),
- 'choose_from_most_used' => __( 'Choose from the most used items', 'text_domain' ),
- 'not_found' => __( 'Not Found', 'text_domain' ),
- );
- $args = array(
- 'labels' => $labels,
- 'hierarchical' => true,
- 'public' => true,
- 'show_ui' => true,
- 'show_admin_column' => true,
- 'show_in_nav_menus' => true,
- 'has_archive' => true,
- 'show_tagcloud' => true,
- 'rewrite' => array('slug' => 'product-cat', 'with_front' => false),
- );
- register_taxonomy( 'product-cat', array( 'all_products' ), $args );
- }
- add_action( 'init', 'taxonomy_for_products_cat', 0 );
- //Taxonomy for Products --Tags
- function taxonomy_for_products_tags() {
- $labels = array(
- 'name' => _x( 'Applications', 'Taxonomy General Name', 'text_domain' ),
- 'singular_name' => _x( 'Application', 'Taxonomy Singular Name', 'text_domain' ),
- 'menu_name' => __( 'Products Applications', 'text_domain' ),
- 'all_items' => __( 'All Items', 'text_domain' ),
- 'parent_item' => __( 'Parent Item', 'text_domain' ),
- 'parent_item_colon' => __( 'Parent Item:', 'text_domain' ),
- 'new_item_name' => __( 'New Item Name', 'text_domain' ),
- 'add_new_item' => __( 'Add New Item', 'text_domain' ),
- 'edit_item' => __( 'Edit Item', 'text_domain' ),
- 'update_item' => __( 'Update Item', 'text_domain' ),
- 'separate_items_with_commas' => __( 'Separate items with commas', 'text_domain' ),
- 'search_items' => __( 'Search Items', 'text_domain' ),
- 'add_or_remove_items' => __( 'Add or remove items', 'text_domain' ),
- 'choose_from_most_used' => __( 'Choose from the most used items', 'text_domain' ),
- 'not_found' => __( 'Not Found', 'text_domain' ),
- );
- $args = array(
- 'labels' => $labels,
- 'hierarchical' => false,
- 'public' => true,
- 'rewrite' => array('slug' => 'app','with_front' => FALSE),
- 'show_ui' => true,
- 'has_archive' => true,
- 'show_admin_column' => true,
- 'show_in_nav_menus' => true,
- 'show_tagcloud' => true,
- );
- register_taxonomy( 'app', array( 'all_products' ), $args );
- }
- add_action( 'init', 'taxonomy_for_products_tags', 0 );
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement