Repository navigation
Docs: Document the naming exception for public registration functions in the PHP guide. - #82396
Open
jorgefilipecosta wants to merge 1 commit into
Open
jorgefilipecosta wants to merge 1 commit into
jorgefilipecosta wants to merge 1 commit into
Conversation
|
Important Draft PR not reviewedDraft PRs are not automatically reviewed by default.
To automatically review draft PRs, update your CodeRabbit configuration: reviews:
auto_review:
drafts: trueComment |
jorgefilipecosta
force-pushed
the
docs/php-registration-functions-naming-exception
branch
from
September 10, 2026 21:15
f91eec1 to
a1040c7
Compare
jorgefilipecosta
marked this pull request as ready for review
September 14, 2026 16:56
jorgefilipecosta
requested review from
fabiankaegy,
juanmaguitar and
spacedmonkey
as code owners
September 14, 2026 16:56
jorgefilipecosta
force-pushed
the
docs/php-registration-functions-naming-exception
branch
from
September 15, 2026 14:37
a1040c7 to
f3880b7
Compare
Member
Author
jorgefilipecosta
force-pushed
the
docs/php-registration-functions-naming-exception
branch
4 times, most recently
from
September 23, 2026 15:10
fc8c166 to
5dec299
Compare
jorgefilipecosta
force-pushed
the
docs/php-registration-functions-naming-exception
branch
from
September 28, 2026 15:21
5dec299 to
8d1ba34
Compare
… 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
force-pushed
the
docs/php-registration-functions-naming-exception
branch
from
October 27, 2026 21:41
8d1ba34 to
1a11dbb
Compare
🤖 PR meta 🤖🎉 PropsIf you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message. To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. Props Bot commandsYou can trigger Props Bot actions by commenting on this PR:
Updated as activity occurs, without notifying anyone named here. Add the |
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #65973.
Currently, the Gutenberg PHP guide in
lib/README.mdsays that functions ported to Core must use thewp_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 aswp_register_block_template()and had to be renamed toregister_block_template()before it shipped in WordPress 6.7, to matchregister_block_type(),register_block_pattern()andregister_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 likewp_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.mdand 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.