WordPress.org

Make WordPress Core

Opened 2 years ago

Last modified 4 weeks ago

#23925 reopened defect (bug)

get_post_meta does not check for revision

Reported by: jfarthing84 Owned by:
Milestone: Awaiting Review Priority: normal
Severity: normal Version: 3.5.1
Component: Posts, Post Types Keywords: has-patch close
Focuses: Cc:

Description

Every other *_post_meta function does.

Attachments (1)

23925.patch (486 bytes) - added by jfarthing84 2 years ago.

Download all attachments as: .zip

Change History (7)

@jfarthing842 years ago

comment:1 @kovshenin2 years ago

  • Keywords reporter-feedback added

What is the reasoning behind the proposed change? This will break #20564, #23539 and possibly others.

comment:2 in reply to: ↑ description @jfarthing842 years ago

Replying to kovshenin:

Every other *_post_meta function does.

comment:3 @jfarthing842 years ago

  • Keywords reporter-feedback removed

comment:4 @nacin2 years ago

  • Milestone Awaiting Review deleted
  • Resolution set to wontfix
  • Status changed from new to closed

I'm going to wontfix this. The fact that the meta functions check for revisions was a terrible decision at the time, and was done to cover up misuse of the save_post hook. Changing this could break even more things. Leaving it as is. Eventually we'll fork all of these functions and hopefully do away with these entirely.

comment:5 follow-up: @katsar0v4 weeks ago

  • Resolution wontfix deleted
  • Status changed from closed to reopened

Any workaroung ? This seems to be a big bug, which is easy to solve, but wordpress team is not responding...

comment:6 in reply to: ↑ 5 @SergeyBiryukov4 weeks ago

  • Component changed from General to Posts, Post Types
  • Keywords close added
  • Milestone set to Awaiting Review

Replying to katsar0v:

Any workaroung ? This seems to be a big bug, which is easy to solve, but wordpress team is not responding...

There are backwards compatibility concerns, see the response in comment:4.

A workaround is just to check wp_is_post_revision() in your own code before calling get_post_meta().

Note: See TracTickets for help on using tickets.