內容簡介
WordPress on Routes 是一款 WordPress 外掛,主要受 Ruby 微框架啟發。它為您的 WordPress 實例添加了添加自定義路由的功能,對於表單提交、類似 API 的功能等非常有用。
此外掛可以讓您:
向您的 WordPress 安裝添加自定義路由
設置 GET / POST / DELETE 等方法
設置主體(作為文本或模板)或動作(使用 add / do_action)。如果兩者都定義了,則 action 優先於 body 。
設置標頭(例如 ‘Content-Type’ => ‘text/html; charset=UTF-8’)
不包括標頭(例如 ‘Set-Cookie’)
設置參數,例如‘/my/route/:param1/:param2’
使用正則表達式添加代理或按代理過濾
代理過濾器的負邏輯(例如/ ^(!火狐) 。$ /,它告訴“除 Firefox 之外的每個瀏覽器”)
包括標題和底部
有關基本和高級使用示例,請查看https://github.com/markzero/wp-on-routes。
外掛標籤
開發者團隊
原文外掛簡介
WordPress on Routes is a plugin for WordPress, inspired mainly by Ruby micro-frameworks. It adds ability to add custom routes to your WordPress instance. Useful for form submissions, API-like features, etc.
This plugin allows you to:
Add custom routes to your WordPress installation
Set method GET/POST/DELETE etc.
Set body (as text, or template) or action (using add/do_action). If both are defined, action takes precedence over body.
Set header (e.g. ‘Content-Type’ => ‘text/html; charset=UTF-8’)
Exclude header (e.g. ‘Set-Cookie’)
Set parameter like ‘/my/route/:param1/:param2’
Add agents or filter by agents, using regular expressions
Agent filter for negative logic (e.g. /^((?!Firefox).)$/, which tells “every browser except Firefox”)
Include header and footer
For basic and advanced usage examples, take a look at https://github.com/markzero/wp-on-routes.
