GG资源网

使用用户名/密码WordPress到其他源休息呼叫

问题描述:

I have been asked to create some custom content on a wordpress site, basically just some web app stuff (html/css/js), but leveraging data from another source via restcalls. There is a service account un/pwd required, and I am wondering what is best practice/approach in terms of the cross site calls with this un? The wire is encrypted but I certainly don\'t want to store the creds on the client (wordpress admin stuff). I am assuming there is a mechanism to store such on the \'back-end\', filesystem, but I am not even sure such access exists? How you get to this....I have gone through the wordpress admin board and haven\'t found anything that provides access to the filesystem/php files, etc. Perhaps I am not looking in the right place or after the wrong bits?

I have googled but am such a noob with wordpress I am not even sure I have the right approach in mind; any help/advice is greatly appreciated.

EDIT: so if curl is the standard approach for this type of thing, where/how am I able to access the filesystem/php? Is there a specific place this type if thing lives or a convention of where it is placed? Just help with some 101 direction please.

图片转代码服务由CSDN问答提供

感谢您的意见,我们尽快改进~
功能建议

我被要求在wordpress网站上创建一些自定义内容,基本上只是一些网络应用程序的东西(html / css) / js),但通过restcalls利用来自其他来源的数据。 有一个服务帐户un / pwd是必需的,我想知道什么是使用此联合国的跨站点呼叫的最佳实践/方法? 电线是加密的,但我当然不想将信用卡存储在客户端上(wordpress管理员的东西)。 我假设有一种机制可以存储在\'后端\',文件系统,但我甚至不确定这种访问是否存在? 你是如何达到这个....我已经通过wordpress管理板,并没有找到任何提供访问文件系统/ PHP文件等的东西。也许我没有找到正确的地方或错误的位后? </ p>

我用Google搜索了,但是我是一个诺言的wordpress,我甚至不确定我是否有正确的方法; 非常感谢任何帮助/建议。</ p>

编辑:所以如果curl是这种类型的标准方法,我在哪里/如何访问文件系统/ php? 如果事物存在或者放置它的惯例,这个类型是否有特定的地方? 请帮助101方向。</ p>
</ div>

网友观点:

First things first, you will need to develop a plugin for WordPress to properly hook into everything and play nice with everyone else. There are many tutorials for getting started. Here\'s one that integrates with an API

If you have to store things to make your plugin integrate with this third party, you should use the Options API that WP provides to you, with the information set from a settings page. Please don\'t hardcode that into a file somewhere in the code. (I\'ll also mention if you need something more powerful than the plugin options, you can add custom tables)

Now we have code running on WordPress with the information it needs, now it needs to do something. To pull the information from this third party, we can use PHP cURL.

Last, depending on how we want this information to end up being consumed by the user. We can do something simply such as just fetching/injecting the data during a regular WP page load on our custom page. Or we could be fancier and set up a WP REST API endpoint that re-serves the information we got from the 3rd party. Shortcodes? Widgets? Custom Templates? Filter Hooks? There is a lot of ways to present our final interface to the user.

由于网站搬家,部分链接失效,如无法下载,请联系站长!谢谢支持!
1. 带 [亲测] 说明源码已经被站长亲测过!
2. 下载后的源码请在24小时内删除,仅供学习用途!
3. 分享目的仅供大家学习和交流,请不要用于商业用途!
4. 本站资源售价只是赞助,收取费用仅维持本站的日常运营所需!
5. 本站所有资源来源于站长上传和网络,如有侵权请邮件联系站长!
6. 没带 [亲测] 代表站长时间紧促,站长会保持每天更新 [亲测] 源码 !
7. 盗版ripro用户购买ripro美化无担保,若设置不成功/不生效我们不支持退款!
8. 本站提供的源码、模板、插件等等其他资源,都不包含技术服务请大家谅解!
9. 如果你也有好源码或者教程,可以到审核区发布,分享有金币奖励和额外收入!
10.如果您购买了某个产品,而我们还没来得及更新,请联系站长或留言催更,谢谢理解 !
GG资源网 » 使用用户名/密码WordPress到其他源休息呼叫

发表回复

CAPTCHAis initialing...