Make WordPress Core

Opened 18 years ago

Closed 18 years ago

Last modified 18 years ago

#7925 closed defect (bug) (fixed)

update_post_meta() and delete_post_meta() not using wp_is_post_revision() on $post_id, resulting in multiple meta rows and incorrect return values

Reported by: misterbisson Owned by: markjaquith
Priority: normal Milestone: 2.7
Component: General Version:
Severity: normal Keywords: post_meta
Cc: Focuses:

Description

add_post_meta() uses the following block of code to make sure the passed $post_id is a real post, not a revision:
`

make sure meta is added to the post, not a revision
if ( $the_post = wp_is_post_revision($post_id) )

$post_id = $the_post;

`

However, update_post_meta() and delete_post_meta() do not do that. The bug is present in trunk.

Attachments (1)

post.php.diff (800 bytes ) - added by misterbisson 18 years ago.

Download all attachments as: .zip

Change History (5)

#1 @misterbisson
18 years ago

I guess i needed some practice setting file extensions and attaching files. Please delete all but the last.

#2 @markjaquith
18 years ago

  • Milestone 2.82.7
  • Owner changed from anonymous to markjaquith
  • Status newassigned

Thanks for this! I've seen this in action but couldn't figure out what was going on.

#3 @markjaquith
18 years ago

  • Resolutionfixed
  • Status assignedclosed

(In [9252]) Update update_post_meta() and delete_post_meta() to work with post revisions. Props misterbisson. fixes #7925

#4 @markjaquith
18 years ago

(In [9743]) Update update_post_meta() and delete_post_meta() to work with post revisions. Props misterbisson. fixes #7925 for 2.6.x

Note: See TracTickets for help on using tickets.