[wp-trac] [WordPress Trac] #24822: XMLRPC wp.editPost doesn't update existing keys
WordPress Trac
noreply at wordpress.org
Tue Aug 27 22:27:09 UTC 2013
#24822: XMLRPC wp.editPost doesn't update existing keys
--------------------------+----------------------
Reporter: jmaimarc | Owner:
Type: defect (bug) | Status: closed
Priority: normal | Milestone:
Component: XML-RPC | Version: 3.3
Severity: normal | Resolution: invalid
Keywords: has-patch |
--------------------------+----------------------
Comment (by DrewAPicture):
Replying to [comment:10 nacin]:
> > I hit this on a recent project when we noticed multiple values were
being stored on the same meta key without overwriting. We used the exact
suggestion @nacin made above about deleting the key first then re-writing
the value and it works fine.
>
> Deleting the key and then re-adding is only if you wanted to take the
same row in the metadata table and change the ''key''.
>
> If all you want to do is update an existing key, then you need to pass
the meta ID. This is the unique identifier for metadata in the XML-RPC API
and is very important to ensuring that deletes, adds, and updates all
happen properly.
Hmm, I guess I assumed the struct for custom fields was the same for
wp.editPost() and wp.newPost(), apparently not. That's what I get for
assuming.
This kind of situation where there's accurate docs in the Codex and
basically none in the source makes me wonder what else is missing
elsewhere. It also leads me to commend @maxcutler or whomever wrote the
original Codex article for this method.
--
Ticket URL: <http://core.trac.wordpress.org/ticket/24822#comment:11>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software
More information about the wp-trac
mailing list