[wp-trac] [WordPress Trac] #10776: Function for adding 'custom taxonomy tags' when creating posts remotely using xmlrpc

WordPress Trac wp-trac at lists.automattic.com
Sun Sep 13 03:05:57 UTC 2009


#10776: Function for adding 'custom taxonomy tags' when creating posts remotely
using xmlrpc
-------------------------+--------------------------------------------------
 Reporter:  dheerg       |       Owner:  filosofo                                        
     Type:  enhancement  |      Status:  new                                             
 Priority:  high         |   Milestone:  2.9                                             
Component:  Taxonomy     |     Version:  2.8.4                                           
 Severity:  normal       |    Keywords:  custom taxonomy, taxonomy, xmlrpc, taxonomy tags
-------------------------+--------------------------------------------------
 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());
         }
 ?>
 }}}

-- 
Ticket URL: <http://core.trac.wordpress.org/ticket/10776>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list