[wp-xmlrpc] exposing and manipulating custom fields

Dougal Campbell dougal at gunters.org
Tue Nov 13 16:08:00 GMT 2007


Joseph Scott wrote:
> [...]
> Custom fields can be added via wp.newPost/editPost and
> metaWeblog.newPost/editPost following the same general format. If a
> custom field entry included with a post contains an "id" value then an
> update is done. If there is no "id" then an add is done. If there is
> an "id" value and no "key" value then the custom field with that id is
> deleted.
>
> I'm also open to the possibility of a wp.addCustomField(blog_id,
> post_id, key, value) style methods if discussions show that there is
> an interest and a reasonable use for them.

If the new method is going to follow the same overload functionality
(add, modify, or delete, depending on the state of the arguments), then
I was recommend naming it 'setCustomField' rather than 'addCustomField'.
I'm not arguing for or against overloading, just suggesting that 'set'
is more generic than 'add' for a function that does more than just add
values.



-- 
Dougal Campbell <dougal at gunters.org <mailto:dougal at gunters.org>>
http://dougal.gunters.org/ <http://dougal.gunters.org>


More information about the wp-xmlrpc mailing list