字preSS插件连接到一个REST API? [英] Wordpress plugin to connect to a REST API?

查看:144
本文介绍了字preSS插件连接到一个REST API?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

让我们说我有一个服务器上运行一个RESTful API的地方,还有一个单独的,但相关的词preSS站点。

Let's say I have a RESTful API running on a server somewhere, as well as a separate, but related, Wordpress site.

我要对WP站点上显示已经从REST服务器检索WP页面(JSON格式)数据的一些网页,并允许用户查看和/或编辑对WP页上的数据。

I want to have some pages on the WP site that show data on WP pages that has been retrieved from the REST server (in JSON format), and allow the user to view and/or edit the data on WP pages.

例如,假设我有,作为一个REST的出发点,即返回由用户拥有的书籍列表的API。我想要显示的书籍列表,让用户点击一个链接,书上并转到显示细节的书页。

For example, let's say I have, as a REST starting point, an API that returns a list of books owned by a user. I want to display the list of books, allow the user to click on a book link and go to a page that displays the details for the book.

然后,如果用户输入编辑模式,它可以让他/她编辑数据,并通过REST API POST / PUT回服务器。

Then if the user enters "edit mode", it lets him/her edit the data and POST/PUT it back to the server via the REST API.

有没有WP插件,让我创建显示网页和编辑这样的信息?

Is there any WP plugin that lets me create pages that display and edit information like this?

我希望对每个类型的实体,我可以输入一些元数据来说明什么期望在JSON以及如何显示它观看或如何构建它的形式(如iPhorms 一样)。

I would expect that for each type of entity I could enter some metadata to indicate what to expect in the JSON and how to display it for viewing or how to build the form for it (like iPhorms does).

推荐答案

所以字preSS有一些内置的AJAX查询的支持,无论是从管理面板,并在面向用户的页面。

So WordPress has some built-in support for AJAX queries, both from the admin panel and in the user-facing pages.

我不完全了解这一切是如何工作还没有,因为我完全新的到Word preSS编码,但是这似乎是我想要的:

I don't fully understand how it all works yet as I am totally new to WordPress coding, but this seems to be what I want:

<一个href=\"http://$c$cx.word$p$pss.org/AJAX_in_Plugins\">http://$c$cx.word$p$pss.org/AJAX_in_Plugins

感谢moimikey为提WP的Ajax能力。

Thanks to moimikey for mentioning WP's ajax ability.

这篇关于字preSS插件连接到一个REST API?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆