• I’m working on a plugin for WooCommerce. I’ve got a custom post type, DG Orders, that uses the same statuses as WooCommerce orders. When I look at the views of the DG Orders page in the admin, I see

    All (104) | Pending payment (4) | Processing (15) | Completed (85)

    That’s all well and good, but the All view shows “No DG Orders found”. Any thoughts?

    Post type definition:

    function dm_inv_dg_post_type () {
    	$show_in_menu = current_user_can( 'manage_woocommerce' ) ? 'woocommerce' : true;
    
    	register_post_type( "dg_order",	array(
    			'labels' => array(
    					'name' 					=> __( 'Dillon Gage Orders', 'woocommerce' ),
    					'singular_name' 		=> __( 'Dillon Gage Order', 'woocommerce' ),
    					'add_new' 				=> __( 'Add Order', 'woocommerce' ),
    					'add_new_item' 			=> __( 'Add New DG Order', 'woocommerce' ),
    					'edit' 					=> __( 'Edit', 'woocommerce' ),
    					'edit_item' 			=> __( 'Edit Order', 'woocommerce' ),
    					'new_item' 				=> __( 'New DG Order', 'woocommerce' ),
    					'view' 					=> __( 'View Order', 'woocommerce' ),
    					'view_item' 			=> __( 'View Order', 'woocommerce' ),
    					'search_items' 			=> __( 'Search DG Orders', 'woocommerce' ),
    					'not_found' 			=> __( 'No DG Orders found', 'woocommerce' ),
    					'not_found_in_trash' 	=> __( 'No DG Orders found in trash', 'woocommerce' ),
    					'parent' 				=> __( 'Parent Orders', 'woocommerce' ),
    					'menu_name'				=> _x('DG Orders', 'Admin menu name', 'woocommerce')
    				),
    			'description' 			=> __( 'This is where orders to Dillon Gage are stored.', 'woocommerce' ),
    			'public' 				=> false,
    			'show_ui' 				=> true,
    			'capability_type' 		=> 'shop_order',  //TODO: needs to change if we want to add a different capability for dg_orders
    			'map_meta_cap'			=> true,
    			'publicly_queryable' 	=> false,
    			'exclude_from_search' 	=> true,
    			'show_in_menu' 			=> $show_in_menu,
    			'hierarchical' 			=> false,
    			'show_in_nav_menus' 	=> false,
    			'rewrite' 				=> false,
    			'query_var' 			=> false,
    			'supports' 				=> array( 'title', 'comments' ),
    			'has_archive' 			=> false,
    		)
    	);
    }
    add_action('init', 'dm_inv_dg_post_type', 12);

The topic ‘[Inventory plugin for WooCommerce] Admin menu All view’ is closed to new replies.