#38467 closed defect (bug) (wontfix)
XML-RPC: Different type of postid return from getPost and getRecentPosts
Reported by: |
|
Owned by: | |
---|---|---|---|
Milestone: | Priority: | normal | |
Severity: | normal | Version: | 4.6.1 |
Component: | XML-RPC | Keywords: | has-patch |
Focuses: | Cc: |
Description
metaWeblog.getRecentPosts said to return same struct of metaWeblog.getPost. But the postid is string instead of int.
Attachments (1)
Change History (6)
#2
@
9 years ago
Will the Api be updated? I am building a program using that Api. The different type makes me not able to reuse the same way to handle the response.
#3
@
8 years ago
- Keywords has-patch added
1.)
@joshuaavalon is right.
metaWeblog.getRecentPosts
should return the same struct with the same data type as metaWeblog.getPost
. The codex entry for metaWeblog.getRecentPosts
says "struct: see #metaWeblog.getPost for fields".
2.)
Once the modified API code is committed, the sentence "Note that the returned postid is string instead of an integer." will need to be removed.
https://codex.wordpress.org/XML-RPC_MetaWeblog_API#metaWeblog.getRecentPosts
From a different perspective, doesn't the lack of such sentence in the original doc implies the two functions share the same data types?
3.)
I've uploaded a patch.
#4
@
8 years ago
- Resolution set to wontfix
- Status changed from new to closed
@stevenlinx Thank you for your patch but I'll have to close this ticket. This is due that API changes like this can't be done without breaking backwards compatibility. As software depends more strictly towards data type, we can't just change it. Sorry I haven't closed this ticket earlier.
Two better alternatives are using the wp.* XML-RPC methods and then we have off course the new REST API.
Hey Joshua,
Thank you for your first ticket here. I assume you mean https://codex.wordpress.org/XML-RPC_MetaWeblog_API#metaWeblog.getRecentPosts? I just updated the page to reflect your comment.
Anything else that you think that should be addressed within this ticket?
Marko