Opened 16 years ago
Closed 13 years ago
#10776 closed enhancement (fixed)
Function for adding 'custom taxonomy tags' when creating posts remotely using xmlrpc
Reported by: |
|
Owned by: |
|
---|---|---|---|
Milestone: | 3.4 | Priority: | high |
Severity: | normal | Version: | 2.8.4 |
Component: | XML-RPC | Keywords: | |
Focuses: | Cc: |
Description
In a recent project I required adding custom taxonomy tags through xmlrpc, as I could not find any way to do this I added my own function to xmlrpc.php to get the job done.
I figured that as custom taxomomies have been around for a while and enhanced with 2.8 it would be neat if this could be added to the tested further and added to xmlrpc.php
I have tested it with the class-IXR.php library, and it works like a charm.
An example of its usage is:
<?php include '../class-IXR.php'; $rpcurl = new IXR_Client('http://the.location.of/xmlrpc.php'); $username = "username"; $password = "password"; $content['title'] = $title; $content['categories'] = $thecategory; $content['mt_keywords'] = $keywords; $content['mt_excerpt'] = $description; $content['description'] = $body; //Process Custom Taxanomy $content['mt_taxonomy'] = array( array( 'tags' => $thetags, 'taxonomy' => 'custom_taxonomy'), ); if (!$rpcurl->query('metaWeblog.newPost','', $username, $password, $content, true)) { die('An error occurred - '.$rpcurl->getErrorCode().":".$rpcurl->getErrorMessage()); } ?>
Attachments (1)
Change History (12)
#1
follow-up:
↓ 2
@
16 years ago
- Keywords reporter-feedback added; custom taxonomy taxonomy xmlrpc taxonomy tags removed
#2
in reply to:
↑ 1
@
16 years ago
Replying to dd32:
Is there any particular reason for most of the red in that patch?
Most of it seems like its only going to cause loss of functionality
thanks for pointing that out. made a mistake while creating/applying the patch. I have attached the correct one now.
#3
@
16 years ago
- Component changed from Taxonomy to XML-RPC
- Keywords has-patch dev-feedback added; reporter-feedback removed
- Owner changed from filosofo to josephscott
thanks for pointing that out. made a mistake while creating/applying the patch. I have attached the correct one now.
Thought as much :)
dev-feedback for review of implementation/standards (Since i dont have a clue with XMLRPC)
#5
@
16 years ago
- Milestone changed from 2.8.5 to 2.9
All enhancements go into trunk(Next release), Only defects are backported to .x releases, And not every defect is backported either, depends on the actual issue at hand.
#7
@
16 years ago
Why does this use a field name called mt_taxonomy? If this is a brand new field specific to WordPress then it should probably be something like wp_taxonomy.
#8
@
16 years ago
actually that's a good point. the only reason i put it as mt_taxonomy was because it was consistent with mt_keywords and mt_excerpt. But i do get your point. Would you like me to change it?
Is there any particular reason for most of the red in that patch?
Most of it seems like its only going to cause loss of functionality