Opened 12 years ago
Closed 11 years ago
#18434 closed feature request (fixed)
Retrieve post terms via XML-RPC
Reported by: |
|
Owned by: | |
---|---|---|---|
Milestone: | 3.4 | Priority: | normal |
Severity: | normal | Version: | |
Component: | XML-RPC | Keywords: | has-patch |
Focuses: | Cc: |
Description
Attachments (2)
Change History (9)
#3
in reply to:
↑ 2
@
12 years ago
Replying to nprasath002:
@maxcutler
Can u explain the use of the function prepare_term?
The idea is to have only a single place where we perform any manipulation of term data before returning the data to the XML-RPC client.
Since term(s) are used in wp.getTerm, wp.getTerms, wp.getPostTerms, wp.getPost, and wp.getPosts, it makes more sense to have a single function than to have similar/duplicate code in all five.
It's currently a trivial operation, but this will make it easier to modify in the future when/if core adds new fields to terms (like the legendary term meta). It also is a convenient location to have a filter hook for plugins to modify the output.
#4
@
11 years ago
Should there be a argument to get only the terms for one taxonomy instead of all of them? I do believe it is needed since you don't know else from which taxonomy the term is from
#5
@
11 years ago
I think this and #18435 are no longer necessary.
wp.getPostTerms(0, user, pass, post_id)
is basically equivalent to wp.getPost(0, user, pass, post_id, array( 'terms' ))
. And you can do the same thing with wp.editPost
to replace wp.setPostTerms
.
I don't think it's worth the effort of maintaining two methods in core when one will suffice.
Updated patch to use
prepare_term
from #18442 and cleaned up formatting.