前言介紹
- 這款 WordPress 外掛「EASY-JS-WPAPI Client HANDLE for the WordPress REST-API」是 2017-08-21 上架。
- 目前有 10 個安裝啟用數。
- 上一次更新是 2017-09-20,距離現在已有 2783 天。超過一年沒更新,安裝要確認版本是否可用。以及後續維護問題!
- 外掛最低要求 WordPress 4.8 以上版本才可以安裝。
- 有 1 人給過評分。
- 還沒有人在論壇上發問,可能目前使用數不多,還沒有什麼大問題。
外掛協作開發者
外掛標籤
wpapi | node-wpapi | javascript client | basic authentication | cookie authentication |
內容簡介
allation is located at a different URL than 'http://talker-test.com' or 'http://localhost:8080', you will need to adjust the URL specified in the JavaScript file within the theme folder.
Browse to your local WordPress site and ensure that the data from the REST API is being displayed correctly.
簡短描述
輕鬆透過 WordPress REST-API 與 WordPress 模型資料進行互動,無需擔心在製作 JavaScript 主題時
因身分驗證錯誤導致的錯誤,以確保所有使用者/客戶能夠存取您的 WordPress 網站時達到一致的檢視。
描述和功能
我們選擇了捆綁的 node-wpapi 的同構JavaScript客戶端,因為透過此客戶端,您能夠快速啟動和運
行,以在您的安裝 WordPress 網站上顯示實時網站資料,使用 JavaScript 可控的主題或插件。
網路的形貌正在改變。今天,我們可以使用 JavaScript 建立 WordPress 主題。WordPress 成為我
們的模型,我們可以使用 WordPress REST-API 使用 JavaScript 進行主題風格設計。
這個外掛的開發是為了讓網頁開發人員可以輕鬆創建完整的 JavaScript WordPress 主題或 JavaScript-P
HP WordPress 主題,使用像 jQuery、React、OpenUI5 等 JavaScript 框架/庫,用在使用 wpapi.js rest-client 的 WordPress
安裝中。
它依靠 node-wpapi 同構 JavaScript 客戶端來存取 WP REST-API。使用 JavaScript 客戶端存取 REST-API 的
問題是身分驗證問題和私人資料訪問問題,這可能會妨礙網頁的流暢顯示,導致在使用 JavaScript 顯示資料時出現 REST 錯誤。
此外掛程式在其內部解決了這個問題,並使處理 WP REST-API 的 javascript-client 物件 wp 在 WordPress 安裝範圍
內可全球存取。
它處理了三種身分驗證的用例:管理者使用者、非管理員使用者和 WordPress 安裝內部的客戶端。假設您的WordPress 網站URL 是例如:http://talker-test.com 或 http://localhost:8080
當管理員已登入 WordPress 安裝時,WordPress 會切換到 Cookie WP 身分驗證。當用戶端訪問您的 WordPress 網站時,會P-Authentication 切換為 Basic WP-Authentication.
此外,當已經登入您的網站的不是管理員使用者,例如作者或訂閱者時,使用 Basic WP-Authentication 來顯示資料。
然後,我們全球性地創建了 WPAPI,作為網頁安裝範圍的 JavaScript 物件 wp,
以便在 WordPress 安裝中對 WP REST-API 進行交流。
因此,您可以更輕鬆地開始建立下一個 JavaScript WordPress 主題,或存取 WordPress REST-API,以確保和允許所有客戶和使用
者顯示一致、不受阻礙的資料。
有關詳細信息和範例,您可以查看 wp-api.org/node-wpapi 上的 node-wpapi JavaScript 客戶端的文檔。
測試
前往 https://somefunagba.github.io/easyjs-wpapi-rest-client-handle/
點擊 Demo 連結:下載範例 zipped JavaScript 主題和.xml 導入檔。
將主題複製到您的本機 WordPress 主題目錄中並啟用它。
如果您的 WordPress 安裝不在 'http://talker-test.com' 或 'http://localhost:8080' 的 URL,您需要在主題資料夾中的 JavaScript 檔案中修改指定的URL。
瀏覽本地 WordPress 網站,並確保來自 REST API 的資料正確顯示。
原文外掛簡介
Short Description
Easily talk with the WordPress REST-API to access and display your WordPress (model) data without
rest-authentication errors when creating Javascript Themes for consistent views by all users/clients accessing
your WordPress site.
Description and Features
We chose the bundled node-wpapi isomorphic Javascript client, because it is the simplest way to get up and running
quickly to display live website data in your installed WordPress website, using a Javascript-controlled Theme or Plugin
The WEB Landscape is changing. Today, we can use Javascript to build WordPress Themes. WordPress becomes our Model,
which we can theme with Javascript using the WordPress REST-API.
This plugin was developed to make life easy for web developers who which to create full-fledged
Javascript WordPress Themes OR Javascript-PHP WordPress Themes using a Javascript Framework/Library like:
jQuery, React, OpenUI5, et.c. for use in a WordPress installation with the wpapi.js rest-client.
It relies on the node-wpapi isomorphic javascript client to access the WP REST-API. The problem with accessing
the REST-API using javascript-clients is the headache of authentication issues and private data access, which can
hamper fluid display of the web-page, leading to rest-errors when using Javascript to display the data.
This plugin works under the hood and makes the javascript-client object, ‘wp’ that interfaces with the WP REST-API
globally accessible for direct and easy use in a javascript(.js) file under the scope of a WordPress installation.
It handles three authentication use cases: admin user, non-admin user and for a client from inside a WP installation.
Say your WordPress website url is e.g: http://talker-test.com or http://localhost:8080
WordPress switches to Cookie WP Authentication for switched to when an administrator is currently logged in to
the WordPress installation. Basic WP-Authentication is switched to when a Client accesses your WordPress website
When an authenticated non-admin user, like an Author or Subscriber is currently logged in to your website,
it displays data using Basic WP-Authentication.
We then make the WPAPI global as a globally scoped javascript object, wp,
for use in a WordPress Installation to talk with the WP REST-API on the go.
So, with added ease, you can start building your next Javascript Themes for WordPress, or accessing the WP REST-API
So start coding and talking with the WordPress REST-API and display consistent, unhindered data,
as you permit to all your clients, and users.
See Demo WP Installation that shows how this plugin is used to display live website data from the WordPress REST-API
In it we created a sample JS-controlled WordPress theme using jQuery and the ‘wp’ object provided by our bundled
javascript client, which our plugin has made globally scoped and authenticated.
For more info. and examples, you can check out the documentation
of the node-wpapi javascript client at wp-api.org/node-wpapi
Testing
Go to https://somefunagba.github.io/easyjs-wpapi-rest-client-handle/
Click on the Demo link: Download a sample zipped Javascript Theme and a .xml import file.
Copy the theme to your Local WordPress Themes directory and Activate it.
If your WP installation has no posts or a single post. Import the downloaded .xml posts
Go to your site-url homepage e.g: http://localhost:8080/
You should see a demo Blog/News themed website.[Demo Website Image]
Inside the Theme folder, You can play with this theme’s index.js and footer.js files.
各版本下載點
- 方法一:點下方版本號的連結下載 ZIP 檔案後,登入網站後台左側選單「外掛」的「安裝外掛」,然後選擇上方的「上傳外掛」,把下載回去的 ZIP 外掛打包檔案上傳上去安裝與啟用。
- 方法二:透過「安裝外掛」的畫面右方搜尋功能,搜尋外掛名稱「EASY-JS-WPAPI Client HANDLE for the WordPress REST-API」來進行安裝。
(建議使用方法二,確保安裝的版本符合當前運作的 WordPress 環境。
延伸相關外掛(你可能也想知道)
暫無相關外掛推薦。