@@ -7,108 +7,26 @@ resource: Comment
7
7
8
8
<section class =" route " >
9
9
<div class="primary">
10
- <h2>{{ page.resource }} Object Schema</h2>
11
- <table class="attributes">
12
- {% for property in site.data.comments.schema.properties %}
13
- <tr>
14
- <td>
15
- <code>{{ property[0] }}</code><br />
16
- <span class="type">
17
- {{ property[1].type }}{% if property[1].format %}, {% case property[1].format %}
18
- {% when 'date-time' %}
19
- datetime (ISO8601)
20
- {% when 'uri' %}
21
- uri
22
- {% else %}
23
- property[1].format
24
- {% endcase %}{% endif %}
25
- </span>
26
- </td>
27
- <td>
28
- <p>{{ property[1].description }}</p>
29
- {% if property[1].readonly %}
30
- <p>(Read only)</p>
31
- {% endif %}
32
- <p class="context">Context: <code>{{ property[1].context | join:"</code>, <code>"}}</code></p>
33
- </td>
34
- </tr>
35
- {% endfor %}
36
- </table>
10
+ {% include reference-parts/schema.html schema=site.data.comment.schema %}
37
11
</div>
38
12
<div class="secondary">
39
13
<h3>Example Request</h3>
40
14
41
- <code> $ curl -X OPTIONS -i http://demo.wp-api.org/{{ page.route_path }}</code>
15
+ $ curl -X OPTIONS -i http://demo.wp-api.org/{{ site.data.comment.routes['/wp/v2/comments'].nicename }}
42
16
</div>
43
17
</section >
44
18
45
- <section class =" route " >
46
- <h2>List all {{ page.resource }}s</h2>
47
-
48
- <div class="primary">
49
- <h3>Arguments</h3>
50
- <table class="arguments">
51
- {% for arg in site.data.comments.endpoints[0].args %}
52
- <tr>
53
- <td>
54
- <code>{{ arg[0] }}</code><br />
55
- </td>
56
- <td>
57
- <p class="required">
58
- Required: {{ arg[1].required }}
59
- </p>
60
- <p class="default">
61
- {% if arg[1].default %}
62
- Default: <code>{{ arg[1].default }}</code>
63
- {% endif %}
64
- </p>
65
- </td>
66
- </tr>
67
- {% endfor %}
68
- </table>
69
- </div>
70
- <div class="secondary">
71
- <h3>Definition</h3>
19
+ {% assign route=site.data.comment.routes[ '/wp/v2/comments'] %}
20
+ {% include reference-parts/list-item.html route=route %}
72
21
73
- <code> {{ site.data.comments.endpoints[0].methods[0] }} http://demo.wp-api.org/{{ page.route_path }}</code>
74
-
75
- <h3>Example Request</h3>
22
+ {% assign route=site.data.comment.routes[ '/wp/v2/comments/<id >'] %}
23
+ {% include reference-parts/get-item.html route=route %}
76
24
77
- <code>$ curl http://demo.wp-api.org/{{ page.route_path}}</code>
78
- </div>
79
- </section >
80
- <section class =" route " >
81
- <h2>Create a {{ page.resource }}</h2>
82
- <div class="primary">
83
- <h3>Arguments</h3>
84
- <table class="arguments">
85
- {% for arg in site.data.comments.endpoints[1].args %}
86
- <tr>
87
- <td>
88
- <code>{{ arg[0] }}</code><br />
89
- </td>
90
- <td>
91
- <p class="required">
92
- Required: {{ arg[1].required }}
93
- </p>
94
- <p class="default">
95
- {% if arg[1].default %}
96
- Default: <code>{{ arg[1].default }}</code>
97
- {% endif %}
98
- </p>
99
- </td>
100
- </tr>
101
- {% endfor %}
102
- </table>
103
- </div>
104
- <div class="secondary">
105
- <h3>Definition</h3>
106
-
107
- <code> {{ site.data.comments.endpoints[1].methods[0] }} http://demo.wp-api.org/{{ page.route_path }}</code>
108
- </div>
109
- </section >
110
- <h2 >Retrieve a {{ page.resource }}</h2 >
25
+ {% assign route=site.data.comment.routes[ '/wp/v2/comments'] %}
26
+ {% include reference-parts/create-item.html route=route %}
111
27
112
- <h2 >Update a {{ page.resource }}</h2 >
28
+ {% assign route=site.data.comment.routes[ '/wp/v2/comments/<id >'] %}
29
+ {% include reference-parts/update-item.html route=route %}
113
30
114
- <h2 >Delete a {{page.resource}}</h2 >
31
+ {% assign route=site.data.comment.routes[ '/wp/v2/comments/<id >'] %}
32
+ {% include reference-parts/delete-item.html route=route %}
0 commit comments