[wp-xmlrpc] multiple custom fields using metaweblog.newPost

Dougal Campbell dougal at gunters.org
Mon Aug 31 15:59:12 UTC 2009


You're passing the list of custom fields as a hashref, but I think that 
it needs to be an arrayref, instead. Try changing from this:

     'custom_fields' => {
       { "key" => "height", "value" => 500 },
       { "key" => "width", "value" => 750 }
     },

To this:

     'custom_fields' => [
       { "key" => "height", "value" => 500 },
       { "key" => "width", "value" => 750 }
     ],



On Aug 29 2009 6:56 PM, x-wp-xml at chaj.com wrote:
>
> Help, I'm trying to create a new post with custom fields using the 
> following perl script, but there seems to be an issue with the custom 
> fields, only the second one "width" ever seems to get posted. Can't 
> make multiple fields go up. When I add another field, I get the "Odd 
> number of elements in anonymous hash" error. This has got to be 
> something simple - would someone kindly sanity check my syntax? Thanks.
> [...]

-- 
Dougal Campbell <dougal at gunters.org>
http://dougal.gunters.org/
http://twitter.com/dougal
http://twitual.com/


More information about the wp-xmlrpc mailing list