$conf, $runtime; function_exists('chdir') AND chdir(APP_PATH); $r = 'mysql' == $conf['cache']['type'] ? website_set('runtime', $runtime) : cache_set('runtime', $runtime); } function runtime_truncate() { global $conf; 'mysql' == $conf['cache']['type'] ? website_set('runtime', '') : cache_delete('runtime'); } register_shutdown_function('runtime_save'); ?>plugins - Access Wordpress data from external PHP application.|Programmer puzzle solving
最新消息:Welcome to the puzzle paradise for programmers! Here, a well-designed puzzle awaits you. From code logic puzzles to algorithmic challenges, each level is closely centered on the programmer's expertise and skills. Whether you're a novice programmer or an experienced tech guru, you'll find your own challenges on this site. In the process of solving puzzles, you can not only exercise your thinking skills, but also deepen your understanding and application of programming knowledge. Come to start this puzzle journey full of wisdom and challenges, with many programmers to compete with each other and show your programming wisdom! Translated with DeepL.com (free version)

plugins - Access Wordpress data from external PHP application.

matteradmin8PV0评论

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.

Post a comment

comment list (0)

  1. No comments so far