Make WordPress Core

Opened 5 years ago

Closed 4 years ago

Last modified 4 years ago

#45464 closed defect (bug) (fixed)

Document some examples of object types accepted by register_meta()

Reported by: drewapicture's profile DrewAPicture Owned by: sergeybiryukov's profile SergeyBiryukov
Milestone: 5.4 Priority: normal
Severity: normal Version: 3.3
Component: Options, Meta APIs Keywords: good-first-bug has-patch commit
Focuses: docs Cc:


As pointed out in a contributor note by @janwoostendorp, the current description for the $object_type parameter in register_meta() is a little vague: "Type of object this meta is registered to."

We could do better about documenting a few potential object types that it can accept. Obviously it's not limited to core object types, but giving some examples provides insight into what's expected.

Best recommendation for a patch would be to add an open-ended statement to the description along the lines of "Accepts ... or any other object with an associated meta table."

Attachments (2)

45464.diff (6.3 KB) - added by kraftbj 4 years ago.
45464.2.diff (6.3 KB) - added by kraftbj 4 years ago.
Original patch + PHPCS fixes for updated lines.

Download all attachments as: .zip

Change History (10)

#2 @isabel_brison
4 years ago

  • Keywords has-patch added

#3 @SergeyBiryukov
4 years ago

  • Milestone changed from Awaiting Review to 5.4
  • Owner set to SergeyBiryukov
  • Status changed from new to reviewing

4 years ago

4 years ago

Original patch + PHPCS fixes for updated lines.

#4 @kraftbj
4 years ago

45464.diff is sheparddw's original patch added to Trac to make it a bit easier to read/apply using the WP patch command. ( is a handy guide, even though PRs are now accepted).

45464.2.diff fixes a couple of spacing issues in the original patch.

This ticket was mentioned in Slack in #core by david.baumwald. View the logs.

4 years ago

#6 @SergeyBiryukov
4 years ago

  • Keywords commit added

#7 @SergeyBiryukov
4 years ago

  • Resolution set to fixed
  • Status changed from reviewing to closed

In 47390:

Docs: Improve documentation for various metadata functions.

This adds a more specific description for accepted object types: post, comment, term, user, or any other object type with an associated meta table.

Props sheparddw, kraftbj, DrewAPicture, SergeyBiryukov.
Fixes #45464.

#8 @SergeyBiryukov
4 years ago

In 48411:

Docs: Synchronize and correct documentation for various metadata functions and filters.

Follow-up to [47390], [47611], [48192], [48402].

See #49572, #43941, #45464.

Note: See TracTickets for help on using tickets.