kucrut / bridge-menus

菜单的 WP REST API 端点。

安装: 300

依赖: 1

建议: 0

安全性: 0

星星: 1

关注者: 2

分支: 0

开放问题: 0

类型:wordpress-plugin

v0.3.1 2018-11-12 10:28 UTC

This package is auto-updated.

Last update: 2024-09-13 15:14:39 UTC


README

菜单的 WP REST API 端点。

此插件主要为了 Minnie 构建。

需求

  • WordPress 4.7.2+

端点

  • 通过菜单 ID: GET /wp-json/bridge/v1/menus/<id>
  • 通过菜单位置: GET /wp-json/bridge/v1/menus/<location>
{
  "id": 2,
  "name": "Primary",
  "slug": "primary",
  "description": "",
  "items": [
    {
      "id": 4,
      "order": 1,
      "parent": 0,
      "title": "Home",
      "url": "/",
      "attr": "",
      "target": "",
      "classes": [],
      "xfn": "",
      "description": "",
      "object_id": 4,
      "object": "custom",
      "type": "custom",
      "type_label": "Custom Link",
      "children": [
        {
          "id": 29,
          "order": 2,
          "parent": 4,
          "title": "WordPress",
          "url": "http://w.org",
          "attr": "",
          "target": "",
          "classes": [],
          "xfn": "",
          "description": "",
          "object_id": 29,
          "object": "custom",
          "type": "custom",
          "type_label": "Custom Link",
          "children": []
        }
      ]
    },
    {
      "id": 5,
      "order": 3,
      "parent": 0,
      "title": "Sample Page",
      "url": "/sample-page/",
      "attr": "",
      "target": "",
      "classes": [],
      "xfn": "",
      "description": "",
      "object_id": 2,
      "object": "page",
      "type": "post_type",
      "type_label": "Page",
      "children": []
    },
    {
      "id": 6,
      "order": 4,
      "parent": 0,
      "title": "Uncategorized",
      "url": "/blog/category/uncategorized/",
      "attr": "",
      "target": "",
      "classes": [],
      "xfn": "",
      "description": "",
      "object_id": 1,
      "object": "category",
      "type": "taxonomy",
      "type_label": "Category",
      "children": []
    }
  ]
}

变更日志

0.3.1

  • 修复 Walker

0.3.0

  • 从依赖中移除 WP-API。

0.2.0

  • 不要从 item->url 中删除 home_url(),让 Bridge 处理它。

0.1.0

  • 初始