Need examples to work with plugin
foxpcteam opened this issue ยท 2 comments
Hi,
First, thank you for this plugin!
Can you please provide some examples of how to work with this plugin?
-
i want to create some page in admin or in front that users with specific role can access this page.
If user not login. Page will show login form. if user login and don't have the right role he will see message "access denied" -
same for Capabilities. How to work with: user "can edit", "can delete" etc...
-
example of how to work with custom post types
-
example of how to work direct with wp db
Thanks
@foxpcteam Welcome ๐
Sorry for not noticing this issue.๐
Actually, this plugin is still in development.
Recently, I'm working on v2, still in processing, check here
And it would be like:
There are some issue need to deal with the dataProvicer.
v2 might be completed on 2024/06, but it depends on my workload.
To answer your question
- i want to create some page in admin or in front that users with specific role can access this page.
If user not login. Page will show login form. if user login and don't have the right role he will see message "access denied"
To solve this problem, you need to custom wp rest API and check user role in backend.
Withusefulteam/jwt-auth
integrated, you can useget_current_user_id()
to get user_id who send the request.
- same for Capabilities. How to work with: user "can edit", "can delete" etc...
Same as above, the key is, "how to identify user who send request".
- example of how to work with custom post types
There's an example by default, please check here
- example of how to work direct with wp db
You can't access db directly from Front end browser.
If you really want to do that, you might concern integrate withwp-graphQL
This is a plugin integrate with WordPress + Vite + React + refine.dev