wordpress_client 1.0.1 → 2.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.rubocop.yml +124 -69
- data/Changelog.md +4 -0
- data/README.md +36 -13
- data/lib/wordpress_client.rb +0 -3
- data/lib/wordpress_client/client.rb +20 -74
- data/lib/wordpress_client/connection.rb +9 -10
- data/lib/wordpress_client/media.rb +15 -1
- data/lib/wordpress_client/media_parser.rb +1 -0
- data/lib/wordpress_client/post.rb +16 -36
- data/lib/wordpress_client/post_parser.rb +9 -37
- data/lib/wordpress_client/term.rb +1 -1
- data/lib/wordpress_client/version.rb +1 -1
- data/spec/client_spec.rb +17 -181
- data/spec/connection_spec.rb +8 -11
- data/spec/docker/Dockerfile +8 -8
- data/spec/docker/README.md +19 -9
- data/spec/docker/dbdump.sql.gz +0 -0
- data/spec/docker/restore-dbdump.sh +2 -2
- data/spec/fixtures/post-with-metadata.json +99 -1
- data/spec/fixtures/simple-post.json +324 -1
- data/spec/integration/attachments_crud_spec.rb +1 -1
- data/spec/integration/posts_crud_spec.rb +1 -1
- data/spec/integration/posts_finding_spec.rb +0 -69
- data/spec/integration/posts_metadata_spec.rb +11 -11
- data/spec/integration/posts_with_attachments_spec.rb +20 -6
- data/spec/media_spec.rb +13 -0
- data/spec/post_spec.rb +5 -31
- data/spec/support/docker_runner.rb +25 -10
- data/spec/support/wordpress_server.rb +15 -7
- data/wordpress_client.gemspec +11 -12
- metadata +5 -15
- data/lib/wordpress_client/replace_metadata.rb +0 -82
- data/lib/wordpress_client/replace_terms.rb +0 -63
- data/spec/fixtures/post-with-forbidden-metadata.json +0 -1
- data/spec/integration/category_assignment_spec.rb +0 -29
- data/spec/integration/tag_assignment_spec.rb +0 -29
- data/spec/replace_metadata_spec.rb +0 -56
- data/spec/replace_terms_spec.rb +0 -51
data/spec/docker/Dockerfile
CHANGED
@@ -9,6 +9,11 @@ RUN wget -P /var/www/html/ https://wordpress.org/latest.zip && \
|
|
9
9
|
# Copy the WP-Config file
|
10
10
|
RUN cp /var/www/html/wordpress/wp-config-sample.php /var/www/html/wordpress/wp-config.php
|
11
11
|
|
12
|
+
# White list custom metadata fields
|
13
|
+
RUN echo "register_meta('post', 'foo', array('type' => 'integer', 'description' => 'Some kind of integer', 'single' => true, 'show_in_rest' => true));" >>/var/www/html/wordpress/wp-config.php
|
14
|
+
RUN echo "register_meta('post', 'bar', array('type' => 'boolean', 'description' => 'Some kind of boolean', 'single' => true, 'show_in_rest' => true));" >>/var/www/html/wordpress/wp-config.php
|
15
|
+
RUN echo "register_meta('post', 'baz', array('type' => 'string', 'description' => 'Some kind of string', 'single' => true, 'show_in_rest' => true));" >>/var/www/html/wordpress/wp-config.php
|
16
|
+
|
12
17
|
# base image only contains American timezones
|
13
18
|
RUN yum install -y tzdata
|
14
19
|
|
@@ -29,19 +34,14 @@ COPY htaccess /var/www/html/wordpress/.htaccess
|
|
29
34
|
COPY dbdump.sql.gz /tmp/dbdump.sql.gz
|
30
35
|
COPY restore-dbdump.sh /tmp/.restore-dbdump.sh
|
31
36
|
RUN chmod +x /tmp/.restore-dbdump.sh && \
|
32
|
-
echo "if [ -f /tmp/.restore-dbdump.sh ]; then /tmp/.restore-dbdump.sh; rm /tmp/.restore-dbdump.sh; fi" >> /root/.bashrc
|
37
|
+
echo "if [ -f /tmp/.restore-dbdump.sh ]; then /tmp/.restore-dbdump.sh; rm -rf /tmp/.restore-dbdump.sh; fi" >> /root/.bashrc
|
33
38
|
|
34
|
-
### Install
|
39
|
+
### Install Basic Auth plugin
|
40
|
+
# Required for API to be able to make changes
|
35
41
|
|
36
42
|
# We need tar to unpack the WP plugins
|
37
43
|
RUN yum install -y tar
|
38
44
|
|
39
|
-
# WP API
|
40
|
-
# Get download link from https://wordpress.org/plugins/rest-api/
|
41
|
-
RUN curl -SL -o /tmp/rest-api.zip https://downloads.wordpress.org/plugin/rest-api.2.0-beta8.zip \
|
42
|
-
&& unzip /tmp/rest-api.zip -d /var/www/html/wordpress/wp-content/plugins/ \
|
43
|
-
&& rm /tmp/rest-api.zip
|
44
|
-
|
45
45
|
# Basic Auth
|
46
46
|
# Get download link from GitHub or something.
|
47
47
|
RUN curl -SL https://github.com/WP-API/Basic-Auth/archive/master.tar.gz \
|
data/spec/docker/README.md
CHANGED
@@ -26,35 +26,45 @@ This image is based on Appcontainer's Wordpress image, which runs Apache, MySQL
|
|
26
26
|
|
27
27
|
* Username `test`
|
28
28
|
* Password `test`
|
29
|
-
* Plugin `WP-API` is installed
|
30
|
-
* Plugin `Basic-Auth` for `WP-API` installed
|
31
29
|
* `.htaccess` for Pretty Permalinks is set up so the API works
|
32
30
|
|
33
31
|
## Developing the image
|
34
32
|
|
35
33
|
### Re-creating DB dump from scratch
|
36
34
|
|
37
|
-
If you need to regenerate the DB dump, remove the part where the file is copied
|
35
|
+
If you need to regenerate the DB dump, remove the part where the file is copied
|
36
|
+
and restored from the `Dockerfile`, then build and start the image.
|
38
37
|
|
39
38
|
```bash
|
40
|
-
docker build -t wordpress_client_test:dev .
|
41
|
-
docker run -it -p 8181:80 wordpress_client_test:dev
|
39
|
+
docker build -t hemnet/wordpress_client_test:dev .
|
40
|
+
docker run -it -p 8181:80 hemnet/wordpress_client_test:dev
|
42
41
|
```
|
43
42
|
|
44
|
-
You'll get a `bash` shell inside the container. Open your browser and go to the
|
43
|
+
You'll get a `bash` shell inside the container. Open your browser and go to the
|
44
|
+
newly booted application ([`localhost:8181`](http://localhost:8181/)).
|
45
45
|
|
46
|
-
You'll be greeted by the Wordpress installer. Fill in everything and complete
|
46
|
+
You'll be greeted by the Wordpress installer. Fill in everything and complete
|
47
|
+
the installation.
|
48
|
+
|
49
|
+
* Blog title `wordpress_client test`
|
50
|
+
* Username `test`
|
51
|
+
* Password `test`
|
52
|
+
* [Set up permalinks according to **Day and
|
53
|
+
name**!](http://localhost:8181/wp-admin/options-permalink.php)
|
54
|
+
* Without this the provided `.htaccess` will cause API requests to redirect.
|
55
|
+
* [Activate the Basic Auth plugin](http://localhost:8181/wp-admin/plugins.php)
|
47
56
|
|
48
57
|
Then, **in your container's terminal**, run the following command:
|
49
58
|
|
50
59
|
```bash
|
51
|
-
mysqldump -u "$MYSQL_USER" --password="$MYSQL_PASS" --host="$MYSQL_HOST" "$MYSQL_DB" |
|
60
|
+
mysqldump -u "$MYSQL_USER" --password="$MYSQL_PASS" --host="$MYSQL_HOST" "$MYSQL_DB" | \
|
61
|
+
gzip -9 > /tmp/dbdump.sql.gz
|
52
62
|
```
|
53
63
|
|
54
64
|
You can then copy the file to your host using the `docker cp` command:
|
55
65
|
|
56
66
|
```bash
|
57
|
-
docker ps | grep wordpress_client_test:dev
|
67
|
+
docker ps | grep hemnet/wordpress_client_test:dev
|
58
68
|
# See the container ID or name of your running container
|
59
69
|
docker cp THE-CONTAINER-ID:/tmp/dbdump.sql.gz .
|
60
70
|
```
|
data/spec/docker/dbdump.sql.gz
CHANGED
Binary file
|
@@ -2,7 +2,7 @@
|
|
2
2
|
service mysqld start
|
3
3
|
|
4
4
|
gunzip -c /tmp/dbdump.sql.gz | \
|
5
|
-
sed "s/
|
5
|
+
sed "s/localhost:8181/${WORDPRESS_HOST:-localhost:8181}/g" | \
|
6
6
|
mysql \
|
7
7
|
--user="$MYSQL_USER" \
|
8
8
|
--password="$MYSQL_PASS" \
|
@@ -10,4 +10,4 @@ gunzip -c /tmp/dbdump.sql.gz | \
|
|
10
10
|
--batch \
|
11
11
|
"$MYSQL_DB"
|
12
12
|
|
13
|
-
rm /tmp/dbdump.sql.gz
|
13
|
+
rm -rf /tmp/dbdump.sql.gz
|
@@ -1 +1,99 @@
|
|
1
|
-
{
|
1
|
+
{
|
2
|
+
"id": 1,
|
3
|
+
"date": "2015-11-03T07:47:41",
|
4
|
+
"date_gmt": "2015-11-03T07:47:41",
|
5
|
+
"guid": {
|
6
|
+
"rendered": "http://localhost:8080/?p=1"
|
7
|
+
},
|
8
|
+
"modified": "2017-07-25T15:07:30",
|
9
|
+
"modified_gmt": "2017-07-25T15:07:30",
|
10
|
+
"slug": "hello-world",
|
11
|
+
"status": "publish",
|
12
|
+
"type": "post",
|
13
|
+
"link": "http://localhost:8080/2015/11/03/hello-world/",
|
14
|
+
"title": {
|
15
|
+
"rendered": "Hello world!"
|
16
|
+
},
|
17
|
+
"content": {
|
18
|
+
"rendered": "<p>Welcome to WordPress. This is your first post. Edit or delete it, then start writing!</p>\n",
|
19
|
+
"protected": false
|
20
|
+
},
|
21
|
+
"excerpt": {
|
22
|
+
"rendered": "<p>Welcome to WordPress. This is your first post. Edit or delete it, then start writing!</p>\n",
|
23
|
+
"protected": false
|
24
|
+
},
|
25
|
+
"author": 1,
|
26
|
+
"featured_media": 0,
|
27
|
+
"comment_status": "open",
|
28
|
+
"ping_status": "open",
|
29
|
+
"sticky": false,
|
30
|
+
"template": "",
|
31
|
+
"format": "standard",
|
32
|
+
"meta": {
|
33
|
+
"foo": 1,
|
34
|
+
"bar": true,
|
35
|
+
"baz": "wohoo"
|
36
|
+
},
|
37
|
+
"categories": [
|
38
|
+
1
|
39
|
+
],
|
40
|
+
"tags": [],
|
41
|
+
"_links": {
|
42
|
+
"self": [
|
43
|
+
{
|
44
|
+
"href": "http://localhost:8080/wp-json/wp/v2/posts/1"
|
45
|
+
}
|
46
|
+
],
|
47
|
+
"collection": [
|
48
|
+
{
|
49
|
+
"href": "http://localhost:8080/wp-json/wp/v2/posts"
|
50
|
+
}
|
51
|
+
],
|
52
|
+
"about": [
|
53
|
+
{
|
54
|
+
"href": "http://localhost:8080/wp-json/wp/v2/types/post"
|
55
|
+
}
|
56
|
+
],
|
57
|
+
"author": [
|
58
|
+
{
|
59
|
+
"embeddable": true,
|
60
|
+
"href": "http://localhost:8080/wp-json/wp/v2/users/1"
|
61
|
+
}
|
62
|
+
],
|
63
|
+
"replies": [
|
64
|
+
{
|
65
|
+
"embeddable": true,
|
66
|
+
"href": "http://localhost:8080/wp-json/wp/v2/comments?post=1"
|
67
|
+
}
|
68
|
+
],
|
69
|
+
"version-history": [
|
70
|
+
{
|
71
|
+
"href": "http://localhost:8080/wp-json/wp/v2/posts/1/revisions"
|
72
|
+
}
|
73
|
+
],
|
74
|
+
"wp:attachment": [
|
75
|
+
{
|
76
|
+
"href": "http://localhost:8080/wp-json/wp/v2/media?parent=1"
|
77
|
+
}
|
78
|
+
],
|
79
|
+
"wp:term": [
|
80
|
+
{
|
81
|
+
"taxonomy": "category",
|
82
|
+
"embeddable": true,
|
83
|
+
"href": "http://localhost:8080/wp-json/wp/v2/categories?post=1"
|
84
|
+
},
|
85
|
+
{
|
86
|
+
"taxonomy": "post_tag",
|
87
|
+
"embeddable": true,
|
88
|
+
"href": "http://localhost:8080/wp-json/wp/v2/tags?post=1"
|
89
|
+
}
|
90
|
+
],
|
91
|
+
"curies": [
|
92
|
+
{
|
93
|
+
"name": "wp",
|
94
|
+
"href": "https://api.w.org/{rel}",
|
95
|
+
"templated": true
|
96
|
+
}
|
97
|
+
]
|
98
|
+
}
|
99
|
+
}
|
@@ -1 +1,324 @@
|
|
1
|
-
{
|
1
|
+
{
|
2
|
+
"id": 1,
|
3
|
+
"date": "2015-11-03T07:47:41",
|
4
|
+
"date_gmt": "2015-11-03T07:47:41",
|
5
|
+
"guid": {
|
6
|
+
"rendered": "http://example.com/?p=1"
|
7
|
+
},
|
8
|
+
"modified": "2017-07-31T13:26:39",
|
9
|
+
"modified_gmt": "2017-07-31T13:26:39",
|
10
|
+
"slug": "hello-world",
|
11
|
+
"status": "publish",
|
12
|
+
"type": "post",
|
13
|
+
"link": "http://example.com/2015/11/03/hello-world/",
|
14
|
+
"title": {
|
15
|
+
"rendered": "Hello world!"
|
16
|
+
},
|
17
|
+
"content": {
|
18
|
+
"rendered": "<p>Welcome to WordPress. This is your first post. Edit or delete it, then start writing!</p>\n",
|
19
|
+
"protected": false
|
20
|
+
},
|
21
|
+
"excerpt": {
|
22
|
+
"rendered": "<p>Welcome to WordPress. This is your first post. Edit or delete it, then start writing!</p>\n",
|
23
|
+
"protected": false
|
24
|
+
},
|
25
|
+
"author": 1,
|
26
|
+
"featured_media": 5,
|
27
|
+
"comment_status": "open",
|
28
|
+
"ping_status": "open",
|
29
|
+
"sticky": false,
|
30
|
+
"template": "",
|
31
|
+
"format": "standard",
|
32
|
+
"meta": {
|
33
|
+
"foo": 0,
|
34
|
+
"bar": false,
|
35
|
+
"baz": "helo world!"
|
36
|
+
},
|
37
|
+
"categories": [
|
38
|
+
1
|
39
|
+
],
|
40
|
+
"tags": [
|
41
|
+
2
|
42
|
+
],
|
43
|
+
"_links": {
|
44
|
+
"self": [
|
45
|
+
{
|
46
|
+
"href": "http://example.com/wp-json/wp/v2/posts/1"
|
47
|
+
}
|
48
|
+
],
|
49
|
+
"collection": [
|
50
|
+
{
|
51
|
+
"href": "http://example.com/wp-json/wp/v2/posts"
|
52
|
+
}
|
53
|
+
],
|
54
|
+
"about": [
|
55
|
+
{
|
56
|
+
"href": "http://example.com/wp-json/wp/v2/types/post"
|
57
|
+
}
|
58
|
+
],
|
59
|
+
"author": [
|
60
|
+
{
|
61
|
+
"embeddable": true,
|
62
|
+
"href": "http://example.com/wp-json/wp/v2/users/1"
|
63
|
+
}
|
64
|
+
],
|
65
|
+
"replies": [
|
66
|
+
{
|
67
|
+
"embeddable": true,
|
68
|
+
"href": "http://example.com/wp-json/wp/v2/comments?post=1"
|
69
|
+
}
|
70
|
+
],
|
71
|
+
"version-history": [
|
72
|
+
{
|
73
|
+
"href": "http://example.com/wp-json/wp/v2/posts/1/revisions"
|
74
|
+
}
|
75
|
+
],
|
76
|
+
"wp:featuredmedia": [
|
77
|
+
{
|
78
|
+
"embeddable": true,
|
79
|
+
"href": "http://example.com/wp-json/wp/v2/media/5"
|
80
|
+
}
|
81
|
+
],
|
82
|
+
"wp:attachment": [
|
83
|
+
{
|
84
|
+
"href": "http://example.com/wp-json/wp/v2/media?parent=1"
|
85
|
+
}
|
86
|
+
],
|
87
|
+
"wp:term": [
|
88
|
+
{
|
89
|
+
"taxonomy": "category",
|
90
|
+
"embeddable": true,
|
91
|
+
"href": "http://example.com/wp-json/wp/v2/categories?post=1"
|
92
|
+
},
|
93
|
+
{
|
94
|
+
"taxonomy": "post_tag",
|
95
|
+
"embeddable": true,
|
96
|
+
"href": "http://example.com/wp-json/wp/v2/tags?post=1"
|
97
|
+
}
|
98
|
+
],
|
99
|
+
"curies": [
|
100
|
+
{
|
101
|
+
"name": "wp",
|
102
|
+
"href": "https://api.w.org/{rel}",
|
103
|
+
"templated": true
|
104
|
+
}
|
105
|
+
]
|
106
|
+
},
|
107
|
+
"_embedded": {
|
108
|
+
"author": [
|
109
|
+
{
|
110
|
+
"id": 1,
|
111
|
+
"name": "test",
|
112
|
+
"url": "",
|
113
|
+
"description": "",
|
114
|
+
"link": "http://example.com/author/test/",
|
115
|
+
"slug": "test",
|
116
|
+
"avatar_urls": {
|
117
|
+
"24": "http://2.gravatar.com/avatar/55502f40dc8b7c769880b10874abc9d0?s=24&d=mm&r=g",
|
118
|
+
"48": "http://2.gravatar.com/avatar/55502f40dc8b7c769880b10874abc9d0?s=48&d=mm&r=g",
|
119
|
+
"96": "http://2.gravatar.com/avatar/55502f40dc8b7c769880b10874abc9d0?s=96&d=mm&r=g"
|
120
|
+
},
|
121
|
+
"_links": {
|
122
|
+
"self": [
|
123
|
+
{
|
124
|
+
"href": "http://example.com/wp-json/wp/v2/users/1"
|
125
|
+
}
|
126
|
+
],
|
127
|
+
"collection": [
|
128
|
+
{
|
129
|
+
"href": "http://example.com/wp-json/wp/v2/users"
|
130
|
+
}
|
131
|
+
]
|
132
|
+
}
|
133
|
+
}
|
134
|
+
],
|
135
|
+
"replies": [
|
136
|
+
[
|
137
|
+
{
|
138
|
+
"id": 1,
|
139
|
+
"parent": 0,
|
140
|
+
"author": 0,
|
141
|
+
"author_name": "Mr WordPress",
|
142
|
+
"author_url": "https://wordpress.org/",
|
143
|
+
"date": "2015-11-03T07:47:41",
|
144
|
+
"content": {
|
145
|
+
"rendered": "<p>Hi, this is a comment.<br />\nTo delete a comment, just log in and view the post's comments. There you will have the option to edit or delete them.</p>\n"
|
146
|
+
},
|
147
|
+
"link": "http://example.com/2015/11/03/hello-world/#comment-1",
|
148
|
+
"type": "comment",
|
149
|
+
"author_avatar_urls": {
|
150
|
+
"24": "http://0.gravatar.com/avatar/?s=24&d=mm&r=g",
|
151
|
+
"48": "http://1.gravatar.com/avatar/?s=48&d=mm&r=g",
|
152
|
+
"96": "http://2.gravatar.com/avatar/?s=96&d=mm&r=g"
|
153
|
+
},
|
154
|
+
"_links": {
|
155
|
+
"self": [
|
156
|
+
{
|
157
|
+
"href": "http://example.com/wp-json/wp/v2/comments/1"
|
158
|
+
}
|
159
|
+
],
|
160
|
+
"collection": [
|
161
|
+
{
|
162
|
+
"href": "http://example.com/wp-json/wp/v2/comments"
|
163
|
+
}
|
164
|
+
],
|
165
|
+
"up": [
|
166
|
+
{
|
167
|
+
"embeddable": true,
|
168
|
+
"post_type": "post",
|
169
|
+
"href": "http://example.com/wp-json/wp/v2/posts/1"
|
170
|
+
}
|
171
|
+
]
|
172
|
+
}
|
173
|
+
}
|
174
|
+
]
|
175
|
+
],
|
176
|
+
"wp:featuredmedia": [
|
177
|
+
{
|
178
|
+
"id": 5,
|
179
|
+
"date": "2017-07-31T13:23:01",
|
180
|
+
"slug": "food-waffles-e1430873095640",
|
181
|
+
"type": "attachment",
|
182
|
+
"link": "http://example.com/2015/11/03/hello-world/food-waffles-e1430873095640/",
|
183
|
+
"title": {
|
184
|
+
"rendered": "food-waffles-e1430873095640"
|
185
|
+
},
|
186
|
+
"author": 1,
|
187
|
+
"caption": {
|
188
|
+
"rendered": ""
|
189
|
+
},
|
190
|
+
"alt_text": "",
|
191
|
+
"media_type": "image",
|
192
|
+
"mime_type": "image/png",
|
193
|
+
"media_details": {
|
194
|
+
"width": 128,
|
195
|
+
"height": 89,
|
196
|
+
"file": "2015/11/food-waffles-e1430873095640.png",
|
197
|
+
"image_meta": {
|
198
|
+
"aperture": "0",
|
199
|
+
"credit": "",
|
200
|
+
"camera": "",
|
201
|
+
"caption": "",
|
202
|
+
"created_timestamp": "0",
|
203
|
+
"copyright": "",
|
204
|
+
"focal_length": "0",
|
205
|
+
"iso": "0",
|
206
|
+
"shutter_speed": "0",
|
207
|
+
"title": "",
|
208
|
+
"orientation": "0",
|
209
|
+
"keywords": []
|
210
|
+
},
|
211
|
+
"sizes": {}
|
212
|
+
},
|
213
|
+
"source_url": "http://example.com/wp-content/uploads/2015/11/food-waffles-e1430873095640.png",
|
214
|
+
"_links": {
|
215
|
+
"self": [
|
216
|
+
{
|
217
|
+
"href": "http://example.com/wp-json/wp/v2/media/5"
|
218
|
+
}
|
219
|
+
],
|
220
|
+
"collection": [
|
221
|
+
{
|
222
|
+
"href": "http://example.com/wp-json/wp/v2/media"
|
223
|
+
}
|
224
|
+
],
|
225
|
+
"about": [
|
226
|
+
{
|
227
|
+
"href": "http://example.com/wp-json/wp/v2/types/attachment"
|
228
|
+
}
|
229
|
+
],
|
230
|
+
"author": [
|
231
|
+
{
|
232
|
+
"embeddable": true,
|
233
|
+
"href": "http://example.com/wp-json/wp/v2/users/1"
|
234
|
+
}
|
235
|
+
],
|
236
|
+
"replies": [
|
237
|
+
{
|
238
|
+
"embeddable": true,
|
239
|
+
"href": "http://example.com/wp-json/wp/v2/comments?post=5"
|
240
|
+
}
|
241
|
+
]
|
242
|
+
}
|
243
|
+
}
|
244
|
+
],
|
245
|
+
"wp:term": [
|
246
|
+
[
|
247
|
+
{
|
248
|
+
"id": 1,
|
249
|
+
"link": "http://example.com/category/uncategorized/",
|
250
|
+
"name": "Uncategorized",
|
251
|
+
"slug": "uncategorized",
|
252
|
+
"taxonomy": "category",
|
253
|
+
"_links": {
|
254
|
+
"self": [
|
255
|
+
{
|
256
|
+
"href": "http://example.com/wp-json/wp/v2/categories/1"
|
257
|
+
}
|
258
|
+
],
|
259
|
+
"collection": [
|
260
|
+
{
|
261
|
+
"href": "http://example.com/wp-json/wp/v2/categories"
|
262
|
+
}
|
263
|
+
],
|
264
|
+
"about": [
|
265
|
+
{
|
266
|
+
"href": "http://example.com/wp-json/wp/v2/taxonomies/category"
|
267
|
+
}
|
268
|
+
],
|
269
|
+
"wp:post_type": [
|
270
|
+
{
|
271
|
+
"href": "http://example.com/wp-json/wp/v2/posts?categories=1"
|
272
|
+
}
|
273
|
+
],
|
274
|
+
"curies": [
|
275
|
+
{
|
276
|
+
"name": "wp",
|
277
|
+
"href": "https://api.w.org/{rel}",
|
278
|
+
"templated": true
|
279
|
+
}
|
280
|
+
]
|
281
|
+
}
|
282
|
+
}
|
283
|
+
],
|
284
|
+
[
|
285
|
+
{
|
286
|
+
"id": 2,
|
287
|
+
"link": "http://example.com/tag/winamp/",
|
288
|
+
"name": "winamp",
|
289
|
+
"slug": "winamp",
|
290
|
+
"taxonomy": "post_tag",
|
291
|
+
"_links": {
|
292
|
+
"self": [
|
293
|
+
{
|
294
|
+
"href": "http://example.com/wp-json/wp/v2/tags/2"
|
295
|
+
}
|
296
|
+
],
|
297
|
+
"collection": [
|
298
|
+
{
|
299
|
+
"href": "http://example.com/wp-json/wp/v2/tags"
|
300
|
+
}
|
301
|
+
],
|
302
|
+
"about": [
|
303
|
+
{
|
304
|
+
"href": "http://example.com/wp-json/wp/v2/taxonomies/post_tag"
|
305
|
+
}
|
306
|
+
],
|
307
|
+
"wp:post_type": [
|
308
|
+
{
|
309
|
+
"href": "http://example.com/wp-json/wp/v2/posts?tags=2"
|
310
|
+
}
|
311
|
+
],
|
312
|
+
"curies": [
|
313
|
+
{
|
314
|
+
"name": "wp",
|
315
|
+
"href": "https://api.w.org/{rel}",
|
316
|
+
"templated": true
|
317
|
+
}
|
318
|
+
]
|
319
|
+
}
|
320
|
+
}
|
321
|
+
]
|
322
|
+
]
|
323
|
+
}
|
324
|
+
}
|