Wordpress Post Via XMLRPC - Add Multiple Categories Wordpress Post Via XMLRPC - Add Multiple Categories wordpress wordpress

Wordpress Post Via XMLRPC - Add Multiple Categories


I've found the answer after testing some other options like:

'categories'=>array("telesync", "1080p"),

The $content variable would look like this:

$content = array(    'title'=>$title,    'description'=>$body,    'mt_allow_comments'=>0,  // 1 to allow comments    'mt_allow_pings'=>0,  // 1 to allow trackbacks    'post_type'=>'post',    'mt_keywords'=>$keywords,    'categories'=>array("telesync", "1080p"), // I've typed the categories directly here.    'custom_fields' =>  array($customfields));


I know this is a bit late but for those who encounter the same issue, the first guess was the best solution (instead of typing the categories directly, it is best to pass them as variables):

$category =array('telesync','dvdscr');

We just have to remove the 'array' on the categories=>array($category) since we already declared $category as an array. So instead of:

'categories'=>array($category),

use:

'categories'=>$category,

and it should work.