Skip to content

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

@getdave

Description

@getdave

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)

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions