WordPress.org

Make WordPress Core

Opened 3 years ago

Closed 5 months ago

#23925 closed defect (bug) (wontfix)

get_post_meta does not check for revision

Reported by: jfarthing84 Owned by:
Milestone: 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 3 years ago.

Download all attachments as: .zip

Change History (8)

@jfarthing84
3 years ago

#1 @kovshenin
3 years ago

  • Keywords reporter-feedback added

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

#2 in reply to: ↑ description @jfarthing84
3 years ago

Replying to kovshenin:

Every other *_post_meta function does.

#3 @jfarthing84
3 years ago

  • Keywords reporter-feedback removed

#4 @nacin
3 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.

#5 follow-up: @katsar0v
6 months 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...

#6 in reply to: ↑ 5 @SergeyBiryukov
6 months 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().

#7 @wonderboymusic
5 months ago

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

I agree with nacin and sergey

Note: See TracTickets for help on using tickets.