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

Update PHP in Gutenberg docs to include naming exception for registration functions #65973

Open
getdave opened this issue Oct 9, 2024 · 0 comments
Labels
[Type] Developer Documentation Documentation for developers

Comments

@getdave
Copy link
Contributor

getdave commented Oct 9, 2024

In the PR below a "registration function" was named with the wp_ prefix. This followed the documented guidelines for PHP in Gutenberg. However as the discussion below indicates, there is an exception for "registration functions".

We should document the exception to help future contributors.

If @youknowriad or anyone can explain why we have this exception that would help 🙇


          > Do we need to update that documentation or add qualifiers/exceptions to the rules?

It's very hard to come up with a good rule. But yeah for this case (registration functions) it seems better to avoid the prefix.

Is it possible to register a wp_template_part or is this just for wp_templates?

We want to ultimately absorb template parts in patterns and patterns already have registration API.


Can anyone help with the renaming work?

Originally posted by @youknowriad in #61577 (comment)

@getdave getdave added the [Type] Developer Documentation Documentation for developers label Oct 9, 2024
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

No branches or pull requests

1 participant