Skip to content

Docs: Document the naming exception for public registration functions in the PHP guide. - #82396

Open
jorgefilipecosta wants to merge 1 commit into
trunkfrom
docs/php-registration-functions-naming-exception
Open

jorgefilipecosta wants to merge 1 commit into
trunkfrom
docs/php-registration-functions-naming-exception

Conversation

@jorgefilipecosta

Copy link
Copy Markdown
Member

Fixes #65973.

Currently, the Gutenberg PHP guide in lib/README.md says that functions ported to Core must use the wp_ prefix, with no exception for the functions plugin and theme authors call to register things. Following the guide, the block template registration API was added as wp_register_block_template() and had to be renamed to register_block_template() before it shipped in WordPress 6.7, to match register_block_type(), register_block_pattern() and register_block_style(). This PR documents the exception in a new "Public registration functions" section of the guide, with the reason these functions keep the name Core uses from the start and a link to the discussion, and notes that the exception is about matching the existing Core API rather than about registration functions in general, since other Core APIs like wp_register_font_collection() do use the prefix. It also links to the guide from the PHP section of the coding guidelines, which did not reference it.

Testing Instructions

Read the new section in lib/README.md and verify it matches the naming of the block registration functions in Core and the outcome of the discussion in #61577 (comment).

AI usage disclosure: docs and description drafted with AI assistance and reviewed by me.

@jorgefilipecosta jorgefilipecosta added the [Type] Developer Documentation Documentation for developers label Sep 3, 2026
@coderabbitai

coderabbitai Bot commented Sep 3, 2026

Copy link
Copy Markdown

Important

Draft PR not reviewed

Draft PRs are not automatically reviewed by default.

  • Trigger a manual review

To automatically review draft PRs, update your CodeRabbit configuration:

reviews:
  auto_review:
    drafts: true

Comment @coderabbitai help to get the list of available commands.

@jorgefilipecosta
jorgefilipecosta force-pushed the docs/php-registration-functions-naming-exception branch from f91eec1 to a1040c7 Compare September 10, 2026 21:15
@jorgefilipecosta
jorgefilipecosta marked this pull request as ready for review September 14, 2026 16:56
@jorgefilipecosta
jorgefilipecosta force-pushed the docs/php-registration-functions-naming-exception branch from a1040c7 to f3880b7 Compare September 15, 2026 14:37
@jorgefilipecosta jorgefilipecosta added the No Core Sync Required Indicates that any changes do not need to be synced to WordPress Core label Sep 15, 2026
@jorgefilipecosta

Copy link
Copy Markdown
Member Author

Hi @getdave do you think this PR is enough to close #65973? Thank you in advance for any insights.

@jorgefilipecosta
jorgefilipecosta force-pushed the docs/php-registration-functions-naming-exception branch 4 times, most recently from fc8c166 to 5dec299 Compare September 23, 2026 15:10
@jorgefilipecosta
jorgefilipecosta force-pushed the docs/php-registration-functions-naming-exception branch from 5dec299 to 8d1ba34 Compare September 28, 2026 15:21
… in the PHP guide.

The Gutenberg PHP guide said functions ported to Core must use the wp_ prefix, with no exception for the functions extenders call to register things, which led to wp_register_block_template() being renamed to register_block_template() before WordPress 6.7. Document the exception and link the guide from the PHP coding guidelines.
@jorgefilipecosta
jorgefilipecosta force-pushed the docs/php-registration-functions-naming-exception branch from 8d1ba34 to 1a11dbb Compare October 27, 2026 21:41
@github-actions

Copy link
Copy Markdown

🤖 PR meta 🤖

🎉 Props

If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message.

Co-authored-by: jorgefilipecosta <jorgefilipecosta@git.wordpress.org>
Co-authored-by: getdave <get_dave@git.wordpress.org>

To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook.


Props Bot commands

You can trigger Props Bot actions by commenting on this PR:

  • @propsbot add <username> to give props to a GitHub user. Requires write access.
  • @propsbot remove <username> to leave a user out of the props. Requires write access.
  • @propsbot refresh to refresh this list. Adding the props-bot label works too.

Updated as activity occurs, without notifying anyone named here. Add the props-bot label to refresh.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

No Core Sync Required Indicates that any changes do not need to be synced to WordPress Core [Type] Developer Documentation Documentation for developers

Projects

None yet

Development

Successfully merging this pull request may close these issues.

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

1 participant