2010-04-07 2 views
0

XMLRPC를 통해 WordPress API를 사용하여 새 게시물을 제출하려고합니다. 하지만 나는 게시물 태그 (범주도)를 설정할 수 없습니다.게시물을 제출할 때 XMLRPC API를 통해 Wordpress에 게시물 태그를 설정 하시겠습니까?

 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); 

어떤 아이디어가 있습니까?

답변

3
$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; 

이상의 이메일 : [email protected]

1

또한이

$content['custom_fields'] = array(
     array('key' => 'Image', 'value' => $img), 
     array('key' => '_aioseop_keywords', 'value' => $aiokey), 
     array('key' => '_aioseop_title', 'value' => $title), 
    ); 
같은 사용자 정의 필드를 설정할 수 있습니다
관련 문제