WordPress.org

Make WordPress Core

Opened 21 months ago

Closed 5 months ago

Last modified 5 weeks ago

#45464 closed defect (bug) (fixed)

Document some examples of object types accepted by register_meta()

Reported by: DrewAPicture Owned by: 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:

Description

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 6 months ago.
45464.2.diff (6.3 KB) - added by kraftbj 6 months ago.
Original patch + PHPCS fixes for updated lines.

Download all attachments as: .zip

Change History (10)

#2 @isabel_brison
7 months ago

  • Keywords has-patch added

#3 @SergeyBiryukov
7 months ago

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

@kraftbj
6 months ago

@kraftbj
6 months ago

Original patch + PHPCS fixes for updated lines.

#4 @kraftbj
6 months 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. ( https://scribu.net/wordpress/contributing-to-wordpress-using-github.html 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.


5 months ago

#6 @SergeyBiryukov
5 months ago

  • Keywords commit added

#7 @SergeyBiryukov
5 months 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
5 weeks 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.