I have a blog located at one site that when I post into a category, it will auto-post via XMLRPC to another site of mine. This functionality works, but I would like to assign a category to these posts.

Is there any way to do this? The only site that will be posting this way is controlled by me, so I don't care if it's global.



You can do it by sending the 5th parameter to wp.newPost, like this:

$request = xmlrpc_encode_request( "wp.newPost", array( 1, $xmlrpc_username, $xmlrpc_password, $content, $terms) );

Please note the $terms should be in this format: 'Taxonomy names as keys, array of term IDs as values', according to the Codex.

FYI, here is another thread related to your question.

| improve this answer | |
  • I've looked through my code and can't seem to find where to put that. can you advise? cheers – user39156 Feb 3 '14 at 19:07
  • Could you paste your code to your question? The point of my code is you need to add a $terms parameter to the wp.newPost request, which is often left behind. – 1fixdotio Feb 4 '14 at 2:55

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.