[wp-xmlrpc] exposing and manipulating custom fields

David Weiss dave at daveweiss.net
Tue Apr 7 03:27:41 GMT 2009


I can't get this to work, and I don't know if it's due to my lack of  
knowledge with XMLRPC or if there is something else wrong.

I am able to update posts with title, description, etc., but when I  
try to update posts with custom fields, the custom fields do not get  
updated.  Here's a sample of the XML generated by  a request:

POST /wordpress/xmlrpc.php HTTP/1.0
Host: www.mydomain.com
Content-Type: text/xml
User-Agent: The Incutio XML-RPC PHP Library
Content-length: 982

<?xml version="1.0"?>
<methodCall>
<methodName>metaWeblog.editPost</methodName>
<params>
<param><value><string>445</string></value></param>
<param><value><string>********</string></value></param>
<param><value><string>*************</string></value></param>
<param><value><struct>
   <member><name>title</name><value><string>83 Fox Hill</string></ 
value></member>
   <member><name>description</name><value><string>Updated Hello World  
3!</string></value></member>
   <member><name>publish</name><value><boolean>1</boolean></value></ 
member>
   <member><name>custom_fields</name><value><array><data>
   <value><struct>
   <member><name>id</name><value><string>445</string></value></member>
   <member><name>key</name><value><string>_listing_price</string></ 
value></member>
   <member><name>value</name><value><string>380000</string></value></ 
member>
</struct></value>
</data></array></value></member>
</struct></value></param>
<param><value><boolean>1</boolean></value></param>
</params></methodCall>

<?xml version="1.0"?><methodResponse><params><param><value><boolean>1</ 
boolean></value></param></params></methodResponse>


Any ideas where I'm going wrong?

Thanks.



More information about the wp-xmlrpc mailing list