Make WordPress Core

Opened 15 years ago

Closed 15 years ago

#15465 closed defect (bug) (fixed)

add_meta() can return the wrong meta_id

Reported by: cyberhobo's profile cyberhobo Owned by:
Milestone: 3.1 Priority: normal
Severity: normal Version: 3.1
Component: Administration Keywords: has-patch
Focuses: Cc:

Description

I think this is a simple global variable bug.

Currently $wpdb->insert_id is being returned after do_action() is called, which can change that value if the action makes use of the global $wpdb.

Attachments (1)

add_meta.diff (660 bytes) - added by cyberhobo 15 years ago.

Download all attachments as: .zip

Change History (4)

@cyberhobo
15 years ago

#1 @nacin
15 years ago

  • Milestone changed from Awaiting Review to 3.1

#2 @cyberhobo
15 years ago

  • Cc cyberhobo@… added

#3 @ryan
15 years ago

  • Resolution set to fixed
  • Status changed from new to closed

(In [16659]) Save meta id before performing actions since the insert_id can change. Props cyberhobo. fixes #15465

Note: See TracTickets for help on using tickets.