Make WordPress Core

Opened 17 years ago

Closed 14 years ago

#10776 closed enhancement (fixed)

Function for adding 'custom taxonomy tags' when creating posts remotely using xmlrpc

Reported by: dheerg Owned by: josephscott
Priority: high Milestone: 3.4
Component: XML-RPC Version: 2.8.4
Severity: normal Keywords:
Cc: Focuses:

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 17 years ago.

Download all attachments as: .zip

Change History (12)

#1 follow-up: @dd32
17 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

#2 in reply to: ↑ 1 @dheerg
17 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
17 years ago

  • Component Taxonomy → 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
17 years ago

  • Milestone 2.9 → 2.8.5

#5 @dd32
17 years ago

  • Milestone 2.8.5 → 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
17 years ago

  • Keywords has-patch dev-feedback → has-patch, dev-feedback

#7 @josephscott
17 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
17 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
17 years ago

  • Milestone 2.9 → Future Release

#10 @nprasath002
15 years ago

  • Keywords has-patch, dev-feedback → has-patch dev-feedback

Related #18435

#11 @markoheijnen
14 years ago

  • Keywords has-patch dev-feedback removed
  • Milestone Future Release → 3.4
  • Resolution → fixed
  • Status new → closed

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

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