[wp-xmlrpc] Updating Custom Fields Using metaWeblog.editPost

Joseph Scott joseph at josephscott.org
Tue Apr 7 23:14:57 GMT 2009


On Apr 7, 2009, at 3:35 PM, David Weiss wrote:

> The 1-to-1 concept is what I'm after, too.  I think it can be  
> handled without too much of an issue.  Who would ever use custom  
> fields to define the same field more than once per post?
>
> It would lead to unworkable use in the templates, unless you needed  
> an array of something attached to the post.  I'm going to make a  
> change to the API and try to update custom fields via post_id and  
> meta_key and see how it works.  This way, I can say "Update  
> wp_postmeta set meta_value = 'X' where meta_key = 'Y' and post_id =  
> 'Z'".  All you'd need to do is pass in the post_id, meta_key, and  
> meta_value.
>
> I don't want to have to do a get for every post, then figure out  
> which key is which, update the appropriate data, then do a post back  
> to WP.  That's too much work.



Themes can easily handle getting an array of custom fields, not a  
problem at all.

If you are concerned about the number of round trips you'll also want  
to look at system.multicall, which WordPress supports.

--
Joseph Scott
joseph at josephscott.org
http://josephscott.org/






More information about the wp-xmlrpc mailing list