如何使用Codeignitor为WordPress添加自定义字段RPC
问题描述:
这使我疯狂!如何使用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');
马克
答
在这个线程http://wordpress.org/support/topic/add-custom-fields-to-a-post-using-xml-rpc
看看它基本上说,你应该使用metaWeblog.newPost而不是WP API。
答
$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');
请以正确的格式添加答案。所发布的东西不能被弄清楚它在做什么以及它是什么。 – kailash19 2012-12-11 05:56:19