Когда я пытаюсь редактировать custom_fields с помощью wp.editPost. Редактируйте только другие поля, но не настраиваемые поля. Пользовательские поля создаются снова (повторяющиеся поля), но их нужно будет отредактировать.wp.editPost 'API Wordpress' не редактирует настраиваемые поля
Ищу: http://codex.wordpress.org/XML-RPC_WordPress_API/Posts#wp.editPost
Мой массив пользовательских полей:
$content = array(
'post_id' => (int)$idPostWp,
'title' => $modificarPostWpDecode['title'], //ok edit
'description' => $modificarPostWpDecode['content'], //ok edit
'categories' => $modificarPostWpDecode['category'], //ok edit
'custom_fields' => array(
array('key' => 'precio', 'value' => $modificarPostWpDecodeCustom['price']), // no edit, fields will be create again
array('key' => 'category', 'value' => $modificarPostWpDecodeCustom['category']), // no edit, fields will be create again
array('key' => 'estrenar', 'value' => $modificarPostWpDecodeCustom['new']), // no edit, fields will be create again
array('key' => 'currency', 'value' => $modificarPostWpDecodeCustom['currency']), // no edit, fields will be create again
array('key' => 'search', 'value' => $modificarPostWpDecodeCustom['search']) // no edit, fields will be create again
)
);
Мой призыв к WordPress является:
$params = array(1, WPUSER, WPPASS, (int)$idPostWp, $modificarPostWpDecode);
$request = xmlrpc_encode_request('wp.editPost', $params, array('encoding' => 'UTF-8', 'escaping' => 'markup'));
Спасибо большое!
В чем причина использования XML-RPC? Является ли PHP-код запущен на том же сервере wordpress? Если это так, XML-RPC не нужно использовать. – enigma
Код находится на другом сервере. У меня такая же проблема с wp.editPost и metablog.editPost. – davidcm86