#35991 closed enhancement (fixed)
Adding support of terms meta to XML-RPC
Reported by: |
|
Owned by: |
|
---|---|---|---|
Milestone: | 4.9 | Priority: | normal |
Severity: | normal | Version: | 4.4 |
Component: | XML-RPC | Keywords: | has-patch has-unit-tests |
Focuses: | Cc: |
Description
Since I'd need to do a batch custom taxonomy import (with additional meta terms) via XML-RPC, unfortunately I noticed that it seems that the XML-RPC doesn't allow to handle terms meta as introduced in 4.4.
This patch aims to add the support of terms meta to XML-RPC, specifically for wp.addTerm
, wp.getTerms
, wp.editTerm
and wp.editTerms
methods, in same way the API does with post custom fields.
The patch is a starting point and probably has to be revised since it assumes the fine-grained caps for taxonomy terms (see 35614).
Also, the patch add the new has_term_meta()
function to taxonomy.php in order to return also meta term IDs that could be needed in subsequent XMP-RPC wp.editTerm
calls.
Attachments (6)
Change History (20)
#3
in reply to:
↑ 2
@
9 years ago
I just submitted an updated patch with unit tests.
Until the fine-grain taxnomony term will be developed/added to the core (see 35614), all the current_user_can()
statements in the patch (relative to class-wp-xmlrpc-server.php) are for demonstration purpose only and they can be replaced with current_user_can( 'manage_categories' )
PS: I misspelled the related XML-RPC methods in the initial post, the correct ones are of course: wp.newTerm
, wp.getTerm
, wp.editTerm
, wp.getTerms
:-)
#4
@
9 years ago
- Keywords has-unit-tests 4.6-early added; needs-unit-tests removed
- Milestone changed from Awaiting Review to Future Release
Thanks for the patch, @enrico.sorcinelli. Let's look at this for 4.6.
#8
@
9 years ago
- Keywords 4.7-early added; 4.6-early removed
Missed this for 4.6. Let's look next time around.
This ticket was mentioned in Slack in #core by helen. View the logs.
8 years ago
#10
@
8 years ago
I just updated again the patch to the current trunk by updating tests and checks of caps (using edit
/add
/delete_term_meta
introduced in 4.7).
This patch replaces the previous ones.
#12
@
8 years ago
- Keywords 4.7-early removed
- Milestone changed from Future Release to 4.9
- Owner set to boonebgorges
- Status changed from new to assigned
Thank you for the updated patch, @enrico.sorcinelli.
I'd like a few more unit tests to cover the editTerm
endpoint, which I will add myself. I'll also clean up the formatting.
This will require unit tests if it's to be considered.