8000 clearer check of wp_json_v1 · yolabingo/wp-api-python@b3940af · GitHub
[go: up one dir, main page]

Skip to content

Commit b3940af

Browse files
author
derwentx
committed
clearer check of wp_json_v1
1 parent c3137dd commit b3940af

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

wordpress/transport.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,13 +40,17 @@ def api_url(self):
4040
]
4141
return UrlUtils.join_components(components)
4242

43+
@property
44+
def is_wp_json_v1(self):
45+
return self.api == 'wp-json' and self.api_version == 'wp/v1'
46+
4347
@property
4448
def api_ver_url(self):
4549
components = [
4650
self.url,
4751
self.api,
4852
]
49-
if self.api_version != 'wp/v1':
53+
if not self.is_wp_json_v1:
5054
components += [
5155
self.api_version
5256
]
@@ -64,7 +68,7 @@ def endpoint_url(self, endpoint):
6468
self.url,
6569
self.api
6670
]
67-
if self.api_version != 'wp/v1':
71+
if not self.is_wp_json_v1:
6872
components += [
6973
self.api_version
7074
]

0 commit comments

Comments
 (0)
0