這個外掛並未在最新的 3 個 WordPress 主要版本上進行測試。開發者可能不再對這個外掛進行維護或提供技術支援,並可能會與更新版本的 WordPress 產生使用上的相容性問題。

WP REST API Sidebars

描述

An extension for the WP REST API that exposes endpoints for sidebars and widgets.

note: this plugin is under heavy development and will receive frequent feature updates (including documentation) so stay tuned and checkout the github repo for the latest updates

Currently supported endpoints

/wp-json/wp-rest-api-sidebars/v1/sidebars returns a list of registered sidebars

[
    {
        "name": "Sidebar Name",
        "id": "sidebar-id",
        "description": "Sidebar description...",
        "class": "sidebar-class",
        "before_widget": "<aside id=\"%1$s\" class=\"widget %2$s\">",
        "after_widget": "<\/aside>",
        "before_title": "<h1 class=\"widget-title\">",
        "after_title": "<\/h1>"
    }
]

/wp-json/wp-rest-api-sidebars/v1/sidebars/{id} returns the given sidebar

{
    "name": "Sidebar Name",
    "id": "sidebar-id",
    "description": "Sidebar description...",
    "class": "sidebar-class",
    "before_widget": "<aside id=\"%1$s\" class=\"widget %2$s\">",
    "after_widget": "<\/aside>",
    "before_title": "<h1 class=\"widget-title\">",
    "after_title": "<\/h1>",
    "rendered": "<aside id=\"widget-id-1\" class=\"widget widget_widget-id\">...",
    "widgets": [
        {
            "name": "Widget Name",
            "id": "widget-name-1",
            "classname": "widget_widget_name",
            "description": "Widget description",
            "rendered": "<aside id=\"widget-names-1\" class=\"widget widget_widget_name\">..."
        }
    ]
}

安裝

Get the content to the plugin directory and activate the plugin

note: to enable you to use any version/branch of the WP REST API plugin during this rapid development phase there is currently no good way to check if it is active. Therefore make sure that it is before you activate this plugin.

評價

閱讀全部1個評價

貢獻者及開發者

“WP REST API Sidebars” 是一個開源的軟體。以下的人對這個外掛作出了貢獻。

貢獻者

將 WP REST API Sidebars 外掛本地化為台灣繁體中文版。

對開發相關資訊感興趣?

任何人均可瀏覽程式碼、查看 SVN 存放庫,或透過 RSS 訂閱開發記錄

修改日誌

0.1.1

  • Now using a plugin specific endpoint namespace: /wp-rest-api-sidebars/v1
  • Including widgets in the /sidebars/{id} response