Skip to content

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

Open

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)

Activity

  1. added
    [Type] Developer Documentation
    on Oct 9, 2024
  2. added
    [Status] In Progress
    on Sep 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

[Status] In Progress[Type] Developer Documentation

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions