Make WordPress Core

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: dheerg's profile dheerg Owned by: josephscott's profile josephscott
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)

xmlrpc.patch (1.8 KB) - added by dheerg 16 years ago.

Download all attachments as: .zip

Change History (12)

#1 follow-up: @dd32
16 years ago

  • Keywords reporter-feedback added; custom taxonomy taxonomy xmlrpc taxonomy tags removed

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

@dheerg
16 years ago

#2 in reply to: ↑ 1 @dheerg
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 @dd32
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)

#4 @dheerg
16 years ago

  • Milestone changed from 2.9 to 2.8.5

#5 @dd32
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.

#6 @dd32
16 years ago

  • Keywords changed from has-patch dev-feedback to has-patch, dev-feedback

#7 @josephscott
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 @dheerg
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?

#9 @ryan
15 years ago

  • Milestone changed from 2.9 to Future Release

#10 @nprasath002
14 years ago

  • Keywords changed from has-patch, dev-feedback to has-patch dev-feedback

Related #18435

#11 @markoheijnen
13 years ago

  • Keywords has-patch dev-feedback removed
  • Milestone changed from Future Release to 3.4
  • Resolution set to fixed
  • Status changed from new to closed

This has been fixed in #18429 and #18430 for the wp methods

Last edited 13 years ago by markoheijnen (previous) (diff)
Note: See TracTickets for help on using tickets.