@@ -348,14 +348,14 @@ public PostMeta getPostMeta(Long postId, Long metaId) {
348348 }
349349
350350 @ Override
351- public List <PostMeta > getCustomPostMetas (Long postId , String requestPath ) {
352- final ResponseEntity <PostMeta []> exchange = doExchange1 (Request .CUSTOM_POST_METAS , HttpMethod .GET , PostMeta [].class , forExpand (requestPath , postId ), null , null );
351+ public List <PostMeta > getCustomPostMetas (Long postId , String customPostTypeName ) {
352+ final ResponseEntity <PostMeta []> exchange = doExchange1 (Request .CUSTOM_POST_METAS , HttpMethod .GET , PostMeta [].class , forExpand (customPostTypeName , postId ), null , null );
353353 return Arrays .asList (exchange .getBody ());
354354 }
355355
356356 @ Override
357- public PostMeta getCustomPostMeta (Long postId , Long metaId , String requestPath ) {
358- final ResponseEntity <PostMeta > exchange = doExchange1 (Request .CUSTOM_POST_META , HttpMethod .GET , PostMeta .class , forExpand (requestPath , postId , metaId ), null , null );
357+ public PostMeta getCustomPostMeta (Long postId , Long metaId , String customPostTypeName ) {
358+ final ResponseEntity <PostMeta > exchange = doExchange1 (Request .CUSTOM_POST_META , HttpMethod .GET , PostMeta .class , forExpand (customPostTypeName , postId , metaId ), null , null );
359359 return exchange .getBody ();
360360 }
361361
@@ -366,17 +366,24 @@ public PostMeta updatePostMetaValue(Long postId, Long metaId, String value) {
366366
367367 @ Override
368368 public PostMeta updatePostMeta (Long postId , Long metaId , String key , String value ) {
369- return updatePostMeta (postId , metaId , null , value , Request .META );
369+ ImmutableMap .Builder <String , Object > builder = new ImmutableMap .Builder <>();
370+ BiConsumer <String , Object > biConsumer = (key1 , value1 ) -> ofNullable (value1 ).ifPresent (v -> builder .put (key1 , v ));
371+
372+ biConsumer .accept (META_KEY , key );
373+ biConsumer .accept (META_VALUE , value );
374+ final ResponseEntity <PostMeta > exchange = doExchange1 (Request .META , HttpMethod .POST , PostMeta .class , forExpand (postId , metaId ), null , builder .build ());
375+
376+ return exchange .getBody ();
370377 }
371378
372379 @ Override
373- public PostMeta updatePostMeta (Long postId , Long metaId , String key , String value , String requestPath ) {
380+ public PostMeta updateCustomPostMeta (Long postId , Long metaId , String key , String value , String customPostTypeName ) {
374381 ImmutableMap .Builder <String , Object > builder = new ImmutableMap .Builder <>();
375382 BiConsumer <String , Object > biConsumer = (key1 , value1 ) -> ofNullable (value1 ).ifPresent (v -> builder .put (key1 , v ));
376383
377384 biConsumer .accept (META_KEY , key );
378385 biConsumer .accept (META_VALUE , value );
379- final ResponseEntity <PostMeta > exchange = doExchange1 (requestPath , HttpMethod .POST , PostMeta .class , forExpand (postId , metaId ), null , builder .build ());
386+ final ResponseEntity <PostMeta > exchange = doExchange1 (Request . CUSTOM_POST_META , HttpMethod .POST , PostMeta .class , forExpand (customPostTypeName , postId , metaId ), null , builder .build ());
380387
381388 return exchange .getBody ();
382389 }
0 commit comments