[wp-xmlrpc] Hidden Custom Fields - Ruby

Marko Heijnen mailing at markoheijnen.nl
Sun Dec 23 22:54:49 UTC 2012


Hey Bradly,

You can't modify hidden fields trough the XMLRPC. Since it is considered protected. You can however whitelist those fields by using register_meta().
I never used it myself and there isn't a codex page for, so you do need to look in the core for how it works. Some information can be found on trac: http://core.trac.wordpress.org/ticket/19919

Marko

Op 23 dec. 2012, om 23:41 heeft Bradly Swart <brad8711 at gmail.com> het volgende geschreven:

> Hi List,
> 
> I've been putting around the net over the past few days figuring out how to get xmlrpc working with ruby. I'm trying to do some programmatic insertion of products into a WooCommerce site. Running the latest version of Wordpress. I've read some stuff on add_post_meta() but hasnt helped.
> 
> I've managed to get the posting working, as well as custom fields, the problem has come in with hidden fields. In the snippet bellow product_url works fine, _sku doesn't
> 
> snippet as part of the post content:
> -------------------------------------------------------------------------------------------------------------------------
> 'custom_fields' => [{'key' => 'product_url', 'value' => 'http://mysite.com?rsid=9999'},
>                       {'key' => "_sku", 'value' =>  '9999'}]
> -------------------------------------------------------------------------------------------------------------------------
> 
> XMLRPC Call:
> -------------------------------------------------------------------------------------------------------------------------
> post_id = connection.call(
>   'metaWeblog.newPost',
>   1,
>   'user',
>   'password',
>   post,
>   true
> )
> -------------------------------------------------------------------------------------------------------------------------
> 
> Hoping someone can help me out.
> 
> Bradly Swart
> 
> Mobile: +61447068962
> Skype: bradly.swart
> Twitter: @brad8711
> linkedIn: http://za.linkedin.com/in/bradlyswart
> _______________________________________________
> wp-xmlrpc mailing list
> wp-xmlrpc at lists.automattic.com
> http://lists.automattic.com/mailman/listinfo/wp-xmlrpc

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.automattic.com/pipermail/wp-xmlrpc/attachments/20121223/6e2a2616/attachment.htm>


More information about the wp-xmlrpc mailing list