WordPress.org

Make WordPress Core

Opened 9 years ago

Closed 8 years ago

#18434 closed feature request (fixed)

Retrieve post terms via XML-RPC

Reported by: nprasath002 Owned by:
Milestone: 3.4 Priority: normal
Severity: normal Version:
Component: XML-RPC Keywords: has-patch
Focuses: Cc:

Description


Attachments (2)

wp.getPostTerms.patch (2.4 KB) - added by nprasath002 9 years ago.
wp.getPostTerms.2.patch (2.3 KB) - added by maxcutler 8 years ago.

Download all attachments as: .zip

Change History (9)

#1 @maxcutler
8 years ago

  • Cc max@… added

Updated patch to use prepare_term from #18442 and cleaned up formatting.

#2 follow-up: @nprasath002
8 years ago

@maxcutler
Can u explain the use of the function prepare_term?

#3 in reply to: ↑ 2 @maxcutler
8 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 @markoheijnen
8 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 @maxcutler
8 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.

#6 @markoheijnen
8 years ago

For getting yes, not needed. For setting I wasn't sure but I have no problem closing both tickets

#7 @markoheijnen
8 years ago

  • Milestone changed from Awaiting Review to 3.4
  • Resolution set to fixed
  • Status changed from new to closed

Marked as fixed in 3.4

Note: See TracTickets for help on using tickets.