How can i acces the usermeta table from a wordpress database with a JS file in a wordpress plugin?

118 Views Asked by At

I know you can use get_user_meta(), add_user_meta() and update_user_meta() in PHP files, but i'm wondering if there is an equally smart solution for Javascript. Can i use the wordpress rest api to do this?

1

There are 1 best solutions below

0
Pankaj Prajapati On

As far as I know, what you need is a ajax request which can act as a bridge between js and your php code where u call get_usermeta and return the data in your js ajax call. This might help if u don't know about ajax call. How to call ajax in wordpress