How to make a customize role and view a specific plugins base on that role?

is there anyone can suggested or give me an idea. i created a customize WordPress plugin. it was called Spark 3cx client

First when i login using admin account. I can view or access the admin dashboard. Then what i wanted is to access the same page of admin to get the same GUI but only the specific plugin will appear on sidebar, using the customize role/user credential when logged in?

Topic user-roles plugin-development plugin-recommendation menus plugins Wordpress

Category Web


You can a custom admin page with add_menu_page function.

The function has a argument $capability which you can set the which users will be able to view and access the page

add_menu_page

https://developer.wordpress.org/reference/functions/add_menu_page/

Roles and capabilities

https://wordpress.org/support/article/roles-and-capabilities/

About

Geeks Mental is a community that publishes articles and tutorials about Web, Android, Data Science, new techniques and Linux security.