內容簡介
此外掛專為使用 Easy Digital Downloads 銷售免費 WordPress 外掛的附加元件的開發人員所設計。
免費的 WordPress 外掛通常在 wp-admin 控制板中都有一個「附加元件」頁面,顯示該外掛的所有可用附加元件。在大多數情況下,列表是從 RSS 或 json 提取的。
EDD Mark As Addon 為開發人員提供了一種簡單的方式,將 EDD 產品標記為「附加元件」,並透過 WordPress REST API 的新路徑公開所有產品,無需手動編碼提取。
安裝後,所有標記為附加元件的產品都可以透過 wp-json/wp/v2/edd-addons 路徑使用。
範例:
http://example.com/wp-json/wp/v2/edd-addons
開發人員相關資訊
所有附加元件都會被快取到 wp_edd_addons_api_cached 轉換。每次更新或建立下載時都會刪除轉換。
您可以透過篩選器 wp_edd_addons_api_query 修改 REST API 的查詢 $args。
外掛標籤
開發者團隊
原文外掛簡介
This is a plugin built specifically for developers that use Easy Digital Downloads to sell add-ons for freemium WordPress plugins.
It’s often the case that freemium plugins have an “add-ons” page within the wp-admin panel that shows a list of all add-ons available for a plugin. In most cases the list is retrieved from an RSS or json feed.
EDD Mark As Addon provides an easy way to mark EDD products as “add-ons” and exposes all of them through a new route within the WordPress REST API without the need to manually code the feed.
Once installed, all products marked as add-ons are available through the wp-json/wp/v2/edd-addons route.
Example:
http://example.com/wp-json/wp/v2/edd-addons
Some info for developers
All add-ons are cached into the wp_edd_addons_api_cached transient. The transient is deleted each time a download is updated or created.
You can modify the query $args for the REST API through the filter wp_edd_addons_api_query.
