Post Type Products 30 January 2023
Shop Marketplace Listing
// Register Custom Post Type function products_post_type() { $labels = array( 'name' => 'Products', 'singular_name' => 'Product', 'menu_name' => 'Products', 'name_admin_bar' => 'Product', 'archives' => 'Item Archives', 'attributes' => 'Item Attributes', 'parent_item_colon' => 'Parent Product:', 'all_items' => 'All Products', 'add_new_item' => 'Add New Product', 'add_new' => 'New Product', 'new_item' => 'New Item', 'edit_item' => 'Edit Product', 'update_item' => 'Update Product', 'view_item' => 'View Product', 'view_items' => 'View Items', 'search_items' => 'Search products', 'not_found' => 'No products found', 'not_found_in_trash' => 'No products found in Trash', 'featured_image' => 'Featured Image', 'set_featured_image' => 'Set featured image', 'remove_featured_image' => 'Remove featured image', 'use_featured_image' => 'Use as featured image', 'insert_into_item' => 'Insert into item', 'uploaded_to_this_item' => 'Uploaded to this item', 'items_list' => 'Items list', 'items_list_navigation' => 'Items list navigation', 'filter_items_list' => 'Filter items list', ); $rewrite = array( 'slug' => '/en-za/shop/product', 'with_front' => true, 'pages' => true, 'feeds' => true, ); $args = array( 'label' => 'Product', 'description' => 'Product information pages.', 'labels' => $labels, 'supports' => array( 'title', 'editor', 'thumbnail', 'comments', 'custom-fields', 'page-attributes', 'post-formats' ), 'taxonomies' => array( 'departments', 'brands', 'categories', 'tags', 'attributes' ), 'hierarchical' => true, 'public' => true, 'show_ui' => true, 'show_in_menu' => true, 'menu_position' => 5, 'show_in_admin_bar' => true, 'show_in_nav_menus' => true, 'can_export' => true, 'has_archive' => '/en-za/shop/product', 'exclude_from_search' => false, 'publicly_queryable' => true, 'rewrite' => $rewrite, 'capability_type' => 'page', 'show_in_rest' => true, ); register_post_type( 'products', $args ); } add_action( 'init', 'products_post_type', 0 );