public static function register_post_types()
    {
        if (post_type_exists('food_menu')) {
            return;
        }
        do_action('restaurantpress_register_post_type');
        register_post_type('food_menu', apply_filters('restaurantpress_register_post_type_food_menu', array('labels' => array('name' => __('Menu Items', 'restaurantpress'), 'singular_name' => __('Menu Item', 'restaurantpress'), 'menu_name' => _x('Menu Items', 'Admin menu name', 'restaurantpress'), 'all_items' => __('All Menu Items', 'restaurantpress'), 'add_new' => __('Add Menu Item', 'restaurantpress'), 'add_new_item' => __('Add New Menu Item', 'restaurantpress'), 'edit' => __('Edit', 'restaurantpress'), 'edit_item' => __('Edit Menu Item', 'restaurantpress'), 'new_item' => __('New Menu Item', 'restaurantpress'), 'view' => __('View Menu Item', 'restaurantpress'), 'view_item' => __('View Menu Item', 'restaurantpress'), 'search_items' => __('Search Menu Items', 'restaurantpress'), 'not_found' => __('No Menu Items found', 'restaurantpress'), 'not_found_in_trash' => __('No Menu Items found in trash', 'restaurantpress'), 'parent' => __('Parent Menu Item', 'restaurantpress'), 'featured_image' => __('Menu Item Image', 'restaurantpress'), 'set_featured_image' => __('Set menu image', 'restaurantpress'), 'remove_featured_image' => __('Remove menu image', 'restaurantpress'), 'use_featured_image' => __('Use as menu image', 'restaurantpress')), 'description' => __('This is where you can add new menu items to your restaurant.', 'restaurantpress'), 'public' => true, 'show_ui' => true, 'capability_type' => 'food_menu', 'map_meta_cap' => true, 'publicly_queryable' => true, 'exclude_from_search' => false, 'hierarchical' => false, 'query_var' => true, 'rewrite' => array('slug' => 'menu-item', 'with_front' => false, 'feeds' => true), 'supports' => array('title', 'editor', 'excerpt', 'thumbnail', 'comments', 'custom-fields', 'page-attributes', 'publicize', 'wpcom-markdown'), 'has_archive' => true, 'show_in_nav_menus' => true)));
        register_post_type('food_group', apply_filters('restaurantpress_register_post_type_food_group', array('labels' => array('name' => __('Groups', 'restaurantpress'), 'singular_name' => __('Group', 'restaurantpress'), 'menu_name' => _x('Groups', 'Admin menu name', 'restaurantpress'), 'add_new' => __('Add Group', 'restaurantpress'), 'add_new_item' => __('Add New Group', 'restaurantpress'), 'edit' => __('Edit', 'restaurantpress'), 'edit_item' => __('Edit Group', 'restaurantpress'), 'new_item' => __('New Group', 'restaurantpress'), 'view' => __('View Groups', 'restaurantpress'), 'view_item' => __('View Group', 'restaurantpress'), 'search_items' => __('Search Groups', 'restaurantpress'), 'not_found' => __('No Groups found', 'restaurantpress'), 'not_found_in_trash' => __('No Groups found in trash', 'restaurantpress'), 'parent' => __('Parent Group', 'restaurantpress')), 'description' => __('This is where you can add new group for your food menu.', 'restaurantpress'), 'public' => false, 'show_ui' => true, 'capability_type' => 'food_group', 'map_meta_cap' => true, 'publicly_queryable' => false, 'exclude_from_search' => true, 'show_in_menu' => current_user_can('manage_restaurantpress') ? 'restaurantpress' : true, 'hierarchical' => false, 'rewrite' => false, 'query_var' => false, 'supports' => array('title'), 'show_in_nav_menus' => false, 'show_in_admin_bar' => true)));
    }
    /**
     * Add Menu Items Support to Jetpack Omnisearch.
     */
    public static function support_jetpack_omnisearch()
    {
        if (class_exists('Jetpack_Omnisearch_Posts')) {
            new Jetpack_Omnisearch_Posts('food_menu');
        }
    }
    /**
     * Added Menu Items for Jetpack related posts.
     * @param  array $post_types
     * @return array
     */
    public static function rest_api_allowed_post_types($post_types)
    {
        $post_types[] = 'food_menu';
        return $post_types;
    }
}
RP_Post_Types::init();