WordPress.org

Make WordPress Core

Opened 3 years ago

Closed 2 years ago

#15483 closed enhancement (duplicate)

get_post_custom() should use use get_metadata()

Reported by: scribu Owned by:
Milestone: Priority: normal
Severity: normal Version:
Component: General Keywords: has-patch
Focuses: Cc:

Description

I found out that get_post_custom() is equivalent to calling get_metadata() without a meta key, so we should use that.

Attachments (2)

15483.diff (543 bytes) - added by scribu 3 years ago.
15483.2.diff (441 bytes) - added by scribu 3 years ago.
almost equivalent

Download all attachments as: .zip

Change History (9)

scribu3 years ago

comment:1 scribu3 years ago

  • Keywords has-patch commit added

scribu3 years ago

almost equivalent

comment:2 scribu3 years ago

Related: #17013

comment:3 scribu3 years ago

  • Milestone changed from Future Release to 3.2

Patch still applies cleanly.

comment:4 hakre3 years ago

Hmm, get_metadata() contains much more and different lines of code as what you remove with the proposed patch.

comment:5 scribu3 years ago

You've got it backwards: I'm replacing get_post_meta() with get_metadata(), not the other way around.

Of course get_metadata() contains much more code, since it's a more general function.

Please base your objections on tests, not on appearances.

Last edited 3 years ago by scribu (previous) (diff)

comment:6 nacin3 years ago

  • Keywords commit removed
  • Milestone changed from 3.2 to Future Release

I doubt this got the testing or considerations required here. First patch was marked for commit but it wouldn't have worked when ID = 0. As said in IRC, seems fine but not really a necessary change at this time. Punting.

comment:7 scribu2 years ago

  • Milestone Future Release deleted
  • Resolution set to duplicate
  • Status changed from new to closed
Note: See TracTickets for help on using tickets.