Skip to content

Commit 975f631

Browse files
committed
Added ability to define context when querying custom posts
1 parent 19785cd commit 975f631

3 files changed

Lines changed: 8 additions & 1 deletion

File tree

pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
<groupId>com.afrozaar.wordpress</groupId>
66
<artifactId>wp-api-v2-client-java</artifactId>
7-
<version>4.17.1-SNAPSHOT</version>
7+
<version>4.18.0-SNAPSHOT</version>
88

99
<packaging>jar</packaging>
1010

src/main/java/com/afrozaar/wordpress/wpapi/v2/Client.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -163,6 +163,11 @@ public Post getCustomPost(Long id, String requestPath) throws PostNotFoundExcept
163163
return getPost(id, requestPath, Contexts.VIEW);
164164
}
165165

166+
@Override
167+
public Post getCustomPost(Long id, String requestPath, String context) throws PostNotFoundException {
168+
return getPost(id, requestPath, context);
169+
}
170+
166171
@Override
167172
public Post getPost(Long id) throws PostNotFoundException {
168173
return getPost(id, Contexts.VIEW);

src/main/java/com/afrozaar/wordpress/wpapi/v2/api/Posts.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,8 @@ public interface Posts {
3636

3737
Post getCustomPost(Long id, String postTypeName) throws PostNotFoundException;
3838

39+
Post getCustomPost(Long id, String postTypeName, String context) throws PostNotFoundException;
40+
3941
Post getPost(Long id) throws PostNotFoundException;
4042
Post getPost(Long id, String context) throws PostNotFoundException;
4143

0 commit comments

Comments
 (0)