Make WordPress Core

Opened 3 years ago

Closed 3 years ago

Last modified 3 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 3 years ago.
19882.2.diff (726 bytes) - added by scribu 3 years ago.

Download all attachments as: .zip

Change History (7)

@scribu3 years ago

comment:1 @scribu3 years ago

  • Milestone changed from Awaiting Review to 3.4

Related: #19708

@scribu3 years ago

comment:2 @scribu3 years ago

  • Keywords commit added

comment:3 @nacin3 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 @nacin3 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 @nacin3 years ago

In [19910]:

Docs, see ##19882.

Note: See TracTickets for help on using tickets.