[wp-trac] [WordPress Trac] #15049: postavoid add_metadata to insert duplicated entries
WordPress Trac
wp-trac at lists.automattic.com
Wed Oct 6 18:30:05 UTC 2010
#15049: postavoid add_metadata to insert duplicated entries
-------------------------+--------------------------------------------------
Reporter: leogermani | Owner:
Type: enhancement | Status: new
Priority: normal | Milestone: Awaiting Review
Component: Database | Version: 3.1
Severity: normal | Keywords: metadata, post_meta, user_meta
-------------------------+--------------------------------------------------
when calling add_metadata, check if there is already an entry with the
same object id, meta_key, and meta_value. If there is, return false so we
dont have duplicated entries.
The unique paramater of the add_metadata does not handle with that, since
it only cares about the meta_key not beeing duplicated.
When playing with multiple metadatas with the same meta_key, very often
you have to check if a value already exists before adding it. I beleive
add_metadata should handle it automatically.
--
Ticket URL: <http://core.trac.wordpress.org/ticket/15049>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software
More information about the wp-trac
mailing list