plugins - Access Wordpress data from external PHP application.

admin2025-06-04  2

I am a volunteer in a non-profit organization. I have taken over maintenance of a number of apps written in PHP/SQL/Dreamweaver. The apps are over 10 years old. I am migrating these apps from PHP/SQL to Wordpress plugins. I am now using Wordpress for authentication and set a cookie the legacy system recognizes. Some of the functions of the legacy system need to access the user list. Currently I need to maintain users in both systems. I would like to use the Wordpress REST API to access user information in Wordpress. (All user with role = instructor.) All examples of accessing the Wordpress REST API I have found involve JavaScript/Basic Authentication. (But then tell you not to use Basic Authentication.) Can anyone point me to documentation on accessing the REST API from a PHP application on the same server? Thanks

I am a volunteer in a non-profit organization. I have taken over maintenance of a number of apps written in PHP/SQL/Dreamweaver. The apps are over 10 years old. I am migrating these apps from PHP/SQL to Wordpress plugins. I am now using Wordpress for authentication and set a cookie the legacy system recognizes. Some of the functions of the legacy system need to access the user list. Currently I need to maintain users in both systems. I would like to use the Wordpress REST API to access user information in Wordpress. (All user with role = instructor.) All examples of accessing the Wordpress REST API I have found involve JavaScript/Basic Authentication. (But then tell you not to use Basic Authentication.) Can anyone point me to documentation on accessing the REST API from a PHP application on the same server? Thanks

Share Improve this question asked Nov 6, 2018 at 18:56 dsjdsj 638 bronze badges 1
  • There will be two scenarios: 1) why don't you create a backend php page that will parse data directly from WordPress mysql data base. 2) there is an official WordPress rest api but that may not help your needs exactly. Tell me which scenario you are comfortable I will proceed with that – hotheadhacker Commented Jan 27, 2019 at 16:51
Add a comment  | 

1 Answer 1

Reset to default 0

After a lot of reading it appears that JWT Authentication is the best way to go. grazianodev has a good explanation of implementation at:

How to: Make JWT-authenticated requests to the Wordpress API

Thank you. My biggest concern is this answer requires the "JTW Authentication for WP REST API" plugin. I was looking for an answer that did not rely on yet another plugin. I do not understand why with an interface like REST authentication and security appear to be an afterthought and not built in at the beginning.

转载请注明原文地址:http://conceptsofalgorithm.com/Algorithm/1748970680a315262.html

最新回复(0)