2011-03-04 59 views
1

這使我瘋狂!如何使用Codeignitor爲WordPress添加自定義字段RPC

我正在使用Codeignitor的RPC發佈到一個正常工作的WordPress博客,但我無法獲得自定義字段的工作。我認爲custom_fields不正確「打包」的電話?

$thePost = array(array('title' => array('Aston','string'), 
         'description' => array('this is the description','string'), 
         'wp_author_id' => array('2','int'), 
         'mt_keywords' => array('personal finance, money management','string'), 
         'mt_text_more' => array('<a href="http://www.ibm.com">read more</a>','string'), 
         'categories' => array(array('Small Business'),'array'), 
         'custom_fields' => array(array('key' => 'image','value' => 'Say Hello'),'struct')), 
       'struct'); 

馬克

回答

1
$thePost = array(array('title' => array('Aston','string'), 
         'description' => array('this is the description','string'), 
         'wp_author_id' => array('2','int'), 
         'mt_keywords' => array('personal finance, money management','string'), 
         'mt_text_more' => array('<a href="http://www.ibm.com">read more</a>','string'), 
         'categories' => array(array('Small Business'),'array'), 
         'custom_fields' => array(
              array(
               array(
               'key' => 'your key', 
               'value' => 'value' 
              ), 
              'struct') 
             ),'struct')), 
       'struct'); 
+0

請以正確的格式添加答案。所發佈的東西不能被弄清楚它在做什麼以及它是什麼。 – kailash19 2012-12-11 05:56:19

相關問題