[WordPress] 外掛分享: WP Request Callback

首頁外掛目錄 › WP Request Callback
WordPress 外掛 WP Request Callback 的封面圖片
10+
安裝啟用
尚無評分
2362 天前
最後更新
問題解決
WordPress 5.0+ PHP 7.0+ v0.1.0 上架:2019-09-29

內容簡介

此外掛可讓您輕鬆地在網站上的任何頁面中新增一個表單,允許訪客留下他們的姓名和電話以請求回撥。

設定

您可以透過 WordPress 管理員選單中的「設定」,並點擊「WP Request Callback」進入設定頁面。

在此處,您可以新增一個電子郵件地址以接收電子郵件通知,以及 Slack Webhook URL 以啟用直接發送通知到 Slack 頻道。

同時在此頁面上,您可以選擇預設的主題顏色。它會被用作捷徑程式碼的送出按鈕的背景顏色和聚焦輸入的邊框顏色。

此顏色可以透過下面文件所述的捷徑程式碼設定在每個表單上的個別基礎。

設定捷徑程式碼

捷徑程式碼的使用方式如下:[wprc success_message="這是我的自訂成功訊息。" error_message="發生了一些問題。" color="#9f7aea"]

success_message 是表單成功送出後顯示給使用者的文字。這是可選的。如果省略,預設訊息是「感謝您提交回撥請求。」
error_message 是在提交時發生意外錯誤時顯示給使用者的文字。這是可選的。如果省略,預設訊息是「發生了一些問題。請再試一次。」
color 是用於設計表單的按鈕和輸入的十六進制顏色代碼。這是可選的,如果省略,則使用在設定頁面上設定的顏色,或者預設的藍色 (#9f7aea)。

API 文件

此外掛運用 WordPress 的 REST API。

端點

POST /wp-json/wprc/v1/callback-requests

要求主體

name: 必填,字串。
phone: 必填,字串,可以包含數字和空格。

範例:
{ name: '姓名', phone: '01234567890' }

回應

成功
狀態:201
回應資料:「成功」

驗證錯誤
狀態:422
回應資料:{ errors: { name: ['範例驗證錯誤'], phone: ['範例驗證錯誤'] } }

外掛標籤

開發者團隊

⬇ 下載最新版 (v0.1.0) 或搜尋安裝

① 下載 ZIP → 後台「外掛 › 安裝外掛 › 上傳外掛」
② 後台搜尋「WP Request Callback」→ 直接安裝(推薦)
📦 歷史版本下載

原文外掛簡介

Easily add a form to any page on your site to allow visitors to leave their name and number to request a callback.
Settings
The settings page can be reached by clicking on Settings in the WordPress admin menu, and then clicking on WP Request Callback.
Here you can add an email address to receive email notifications, as well as a Slack Webhook URL to enable notifications straight into a Slack channel.
Also on this page you can choose the default theme color. This will be used by the shortcode as the background color of the submit button and the border color of the focussed inputs.
The color can be overridden on a per form basis by using the shortcode settings as documented below.
Configuring the Shortcode
The shortcode usage is as follows: [wprc success_message="This is my custom success message." error_message="Something went wrong." color="#9f7aea"]

success_message is the text displayed to the user after the form is submitted successfully. It is optional and if omitted the default message is ‘Thanks for submitting your callback request.’
error_message is the text displayed to the user if an unexpected error occurs with the submission. It is optional and if omitted the default message is ‘Something went wrong. Please try again.’
color is a hex color code that is used to style the button and inputs of the form. It is optional, and if omitted, the color set on the settings page is used, or blue by default (#9f7aea).

API Documentation
The plugin makes use of the WordPress REST API.
Endpoint
POST /wp-json/wprc/v1/callback-requests
Request Body
name: Required, string.
phone: Required, string, numbers or spaces.
Example:
{ name: ‘Name’, phone: ‘01234567890’ }
Responses
Success
Status: 201
Response data: ‘Success’
Validation error
Status: 422
Response data: { errors: { name: [‘Example validation error’], phone: [‘Example validation error’] } }

延伸相關外掛

文章
Filter
Apply Filters
Mastodon