views:

249

answers:

1

Hi, I am trying to use WordPress API via XMLRPC to submit new posts. But i can't set the post tags (nor the categories).

        echo "Adding $term to blog via XMLRPC ...";
        $client = new IXR_Client("http://$blog.wordpress.com/xmlrpc.php");
        $content = array('title'=>$term,
                         'description'=>"All about $term",
                         'category'=>'barvaz,moshe',
                          'tags'=>'tag1,tag2');
        $client->query('metaWeblog.newPost', 0, $username, $password, $content, true);
        $rv = $client->getResponse();
        print_r($rv);

Any idea?

+2  A: 
$categories[0]="cate1";
$categories[1]="cate2";

$tags[0]="tag1";
$tags[1]="tag2";


...
$content['title'] = $title;
$content['categories'] = $categories;
$content['mt_keywords'] = $tags;
$content['description'] = $description; 

more email : [email protected]

redleaffly