Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Docs: Change register_meta to register_post_meta #16032

Merged
merged 2 commits into from
Jun 10, 2019
Merged

Conversation

Soean
Copy link
Member

@Soean Soean commented Jun 7, 2019

Description

Changes the function register_meta to register_post_meta (added in WP 4.9.8) in the docs. This function is more specific and intuitive for developers. Fore more details see #16025

Fixes #16025

Copy link
Member

@mkaz mkaz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good!

Confirmed by reading the core documentation, it looks like the corresponding relevant piece is: https://developer.wordpress.org/reference/functions/register_meta/

It is recommended to register meta keys for a specific combination of object type and object subtype.

Using register_post_meta automatically registers the subtype, while register_meta requires passing in object subtype which the examples were not.

Copy link
Member

@chrisvanpatten chrisvanpatten left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Love it!

@mkaz mkaz merged commit a5a3c08 into master Jun 10, 2019
@youknowriad youknowriad deleted the docs/register_post_meta branch June 10, 2019 17:25
@gziolo gziolo added this to the Gutenberg 6.0 milestone Jun 11, 2019
@kadamwhite
Copy link
Contributor

I'd missed this PR, and was delighted to discover the docs were updated while referencing this section just now. 🎊 🎉 thank you all!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Type] Developer Documentation Documentation for developers
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Docs: Improve plugin sidebar tutorial meta-registration example
5 participants