Make WordPress Core

Opened 4 years ago

Closed 4 years ago

Last modified 4 years ago

#19882 closed enhancement (fixed)

Make $key parameter optional in get_post_meta()

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


get_post_meta() is a trivial wrapper around get_metadata()

In get_metadata(), the $key parameter is optional, but in get_post_meta() it's not.

This should be fixed.

Attachments (2)

19882.diff (525 bytes) - added by scribu 4 years ago.
19882.2.diff (726 bytes) - added by scribu 4 years ago.

Download all attachments as: .zip

Change History (7)

@scribu4 years ago

comment:1 @scribu4 years ago

  • Milestone changed from Awaiting Review to 3.4

Related: #19708

@scribu4 years ago

comment:2 @scribu4 years ago

  • Keywords commit added

comment:3 @nacin4 years ago

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

In [19908]:

Allow get_post_meta() to be called with only a post ID, as get_metadata() handles this. props scribu, fixes #19882.

comment:4 @nacin4 years ago

In [19909]:

Allow get_comment_meta() to be called with only a comment ID, something get_metadata() allows. Same functionality as get_user_meta() and get_post_meta(). see #19882.

comment:5 @nacin4 years ago

In [19910]:

Docs, see ##19882.

Note: See TracTickets for help on using tickets.