PHP-only Block Registration

๐ **Source:** [PHP-only Block Registration](https://make.wordpress.org/core/2026/03/03/php-only-block-registration/)
> [!note]+ Document Notes
> tags: #wordpress #blocks #gutenberg #php #block-development
> author: Miguel Fonseca
> source: Make WordPress Core
> reference: https://make.wordpress.org/core/2026/03/03/php-only-block-registration/
> date created: 2024-12-19 18:47
>
> # ๐ท๏ธ Title: PHP-only block registration
>
<!-- deep-read:sections start -->
## ๐งฐ Action Inbox
- [H1] Implement autoRegister flag for server-side blocks โ eliminates JavaScript requirements #wordpress
- [H2] Test automatic Inspector Controls generation โ validate attribute type support #blocks
- [H3] Review #64639 implementation details โ understand technical limitations #gutenberg
## ๐งญ Table of Contents
- [[#๐ Summary]]
- [[#๐ Main Content]]
- [[#๐๏ธ Notes]]
- [[#๐ References]]
- [[#๐ฃ๏ธ Paraphrase]]
- [[#๐ฐ Newsletter]]
- [[#โ
Action Items]]
- [[#๐งช Hypotheses]]
- [[#๐ Methodology]]
- [[#โ Questions]]
- [[#๐ฎ Future Research]]
- [[#๐ก Implications]]
- [[#๐ง Learning Styles Assessment]]
- [[#๐ Accessibility Assessment]]
- [[#๐ DEIB Assessment]]
- [[#โ
Logical Validity]]
- [[#๐ก๏ธ DARVO Analysis]]
- [[#๐ฏ Conclusion]]
### ๐ References
- [WordPress Trac #64639](https://core.trac.wordpress.org/ticket/64639)
- [Block Editor Handbook](https://developer.wordpress.org/block-editor/)
## ๐ Summary
- WordPress 7.0 introduces PHP-only block registration using the autoRegister flag
- Enables server-side blocks without JavaScript requirements for simple use cases
- Automatically generates Inspector Controls for supported attribute types
- Targets blocks that only need server-side rendering without high interactivity
- Simplifies block development workflow for PHP-focused developers
## ๐ Main Content
WordPress Core has introduced a new capability for developers to create blocks using only PHP, without requiring JavaScript registration. This feature targets simple blocks that primarily need server-side rendering and don't require complex user interactions.
The implementation uses a new `autoRegister` flag within the `supports` array of `register_block_type()`. When enabled, WordPress automatically handles the JavaScript registration and generates appropriate controls in the block editor's Inspector Controls sidebar based on the block's defined attributes.
The system supports automatic control generation for common attribute types including strings, integers, booleans, and enums. However, it has limitations - controls are not generated for attributes with the `local` role or for unsupported attribute types like file uploads.
This development addresses a significant barrier for PHP developers who found the JavaScript requirements of block development challenging, potentially expanding the pool of developers who can create custom blocks.
## ๐๏ธ Notes
#### ๐ [Article Start] โ [H1] PHP-only block registration introduction
- Key idea: Developers can now create simple blocks using only PHP without JavaScript
- Evidence: "This is meant for blocks that only need server-side rendering and aren't meant to be highly interactive"
#### ๐ [Code Example] โ [H2] Implementation with autoRegister flag
- Key idea: New autoRegister flag in supports array enables PHP-only registration
- Evidence: "'supports' => array( 'autoRegister' => true )"
#### ๐ [Attributes Section] โ [H3] Supported attribute types demonstration
- Key idea: Multiple attribute types are supported with automatic control generation
- Evidence: "string, integer, boolean, and enum types with defaults shown in example"
#### ๐ [Control Generation] โ [H2] Automatic Inspector Controls creation
- Key idea: Editor automatically generates controls for editing block attributes
- Evidence: "the editor will automatically generate controls in the Inspector Controls sidebar"
#### ๐ [Limitations] โ [H3] Control generation restrictions
- Key idea: Not all attribute types receive automatic controls
- Evidence: "controls will not be generated for attributes with the local role or for attributes whose types are not supported"
#### ๐ [Community Response] โ [H2] Developer enthusiasm for PHP-only approach
- Key idea: Strong positive reception from WordPress developer community
- Evidence: "This is THE FIRST block-editor-related good news since Gutenberg was first implemented"
#### ๐ [Missing Features] โ [H3] File upload limitations acknowledged
- Key idea: Advanced input types like file uploads not yet supported
- Evidence: "What about image/file uploads etc?" with response "it definitly needs more love"
#### ๐ [Technical Reference] โ [H3] Implementation ticket reference
- Key idea: Full technical details available in WordPress Trac
- Evidence: "See #64639 for more details"
## ๐ References
- [WordPress Core Trac #64639](https://core.trac.wordpress.org/ticket/64639)
- [WordPress Block Editor Handbook](https://developer.wordpress.org/block-editor/)
- [WordPress Developer Documentation](https://developer.wordpress.org/)
## ๐ฃ๏ธ Paraphrase
- WordPress 7.0 introduces the ability to register blocks using only PHP code, eliminating the JavaScript requirement for simple server-rendered blocks
- The new autoRegister flag automatically handles editor integration and generates appropriate controls for common attribute types like text, numbers, booleans, and select options
- This change significantly lowers the barrier to entry for PHP developers who want to create custom blocks without learning complex JavaScript workflows
## ๐ฐ Newsletter
Great news for WordPress developers who prefer PHP! WordPress 7.0 introduces PHP-only block registration, making it possible to create custom blocks without writing any JavaScript. Simply use the new `autoRegister` flag in your block's supports array, and WordPress will automatically generate the necessary editor controls.
This is particularly valuable for creating simple content blocks, custom post displays, or theme-specific components that don't need complex interactivity. The feature supports common attribute types and generates Inspector Controls automatically, streamlining the development process significantly.
While there are still limitations around advanced input types like file uploads, this represents a major step toward making block development more accessible to the broader WordPress developer community.
Resources: [Learn WordPress](https://learn.wordpress.org/), [Developer Docs](https://developer.wordpress.org/), [Block Editor Handbook](https://developer.wordpress.org/block-editor/)
## โ
Action Items
#### WordPress
- Core: Test autoRegister implementation across different block scenarios
- Documentation: Update Block Editor Handbook with PHP-only registration examples
- Training: Create lesson plans for PHP developers transitioning to block development
- Community: Promote new feature at WordCamps and developer meetups
#### DevRel
- Developer advocacy: Create demo blocks showcasing PHP-only registration capabilities
- Education: Host workshops on simplified block development workflow
- Developer experience: Document limitations and workarounds for unsupported attribute types
- Community management: Monitor feedback on missing features like file upload controls
## ๐งช Hypotheses
- PHP-only block registration will increase the number of developers creating custom blocks
- Automatic Inspector Controls generation will reduce development time for simple blocks
- The feature will be particularly adopted by theme developers and agencies serving small businesses
- Limitations around file uploads and advanced input types will drive future enhancement requests
### ๐ Methodology
- Survey WordPress developers on block development adoption before and after PHP-only registration
- Measure the number of plugins using autoRegister flag in WordPress plugin directory
- Track community forum questions about block development complexity over time
### โ Questions
- How will this affect the JavaScript-first philosophy of the block editor?
- What additional attribute types should receive automatic control generation?
- Will this create fragmentation between PHP-only and JavaScript-enabled blocks?
### ๐ฎ Future Research
- Performance impact of automatic control generation versus manual JavaScript registration
- Developer experience studies comparing PHP-only versus traditional block development
- Usage patterns analysis of autoRegister adoption across different types of WordPress sites
### ๐ก Implications
- Practice: PHP developers can now create blocks without learning React and JavaScript
- Policy: May influence WordPress contribution requirements for block-related features
- Education: Training materials need updates to cover both development approaches
- Funding: Could reduce development costs for simple custom block implementations
### ๐ง Learning Styles Assessment
Reading level estimate: Grade 12
#### ๐ Visual learners
- Present: Code example with clear syntax highlighting and structure
- Improve: Block editor screenshot showing generated Inspector Controls
#### ๐ Aural learners
- Present: None currently available
- Improve: 3-minute audio summary explaining the feature and its benefits
#### ๐ฃ๏ธ Verbal learners
- Present: Clear definitions of autoRegister, Inspector Controls, server-side rendering
- Improve: Analogies comparing PHP-only blocks to traditional shortcodes
#### ๐งฉ Kinesthetic learners
- Present: Step-by-step code example with complete implementation
- Improve: Interactive playground for testing PHP-only block registration
#### ๐ง Logical learners
- Present: Clear before/after comparison of development requirements
- Improve: Decision tree for choosing PHP-only versus JavaScript block development
#### ๐งโ๐คโ๐ง Social learners
- Present: Community comments showing developer reactions and discussions
- Improve: Forum link for asking questions about implementation
#### ๐งโโ๏ธ Solitary learners
- Present: Complete code example for independent implementation
- Improve: Self-assessment checklist for successful PHP-only block creation
#### ๐ฟ Naturalistic learners
- Present: None specifically addressed
- Improve: Explanation of how this fits into the broader WordPress ecosystem evolution
### ๐ Accessibility Assessment
#### Screen reader semantics
- Present: Good heading structure, code properly marked up
- Improve: Add aria-labels to code examples describing their purpose
#### Keyboard navigation
- Present: Standard web navigation available
- Improve: Ensure all interactive elements are keyboard accessible
#### Contrast and readability
- Present: Standard WordPress.org theme meets basic contrast requirements
- Improve: Verify code syntax highlighting meets contrast standards
#### Text resizing and reflow
- Present: Responsive design supports text scaling
- Improve: Test code examples at 200% zoom for readability
#### Media and captions
- Present: No media content to assess
- Improve: Add captions if video demonstrations are created
#### Forms and interactions
- Present: Basic comment form with appropriate labels
- Improve: Enhance error messaging for failed comment submissions
### ๐ DEIB Assessment
#### Cultural breadth
- Present: Technical content is culturally neutral
- Improve: Include examples relevant to different regions and use cases
#### Inclusive language
- Present: Uses clear technical language without excluding jargon
- Improve: Define all technical terms for developers new to block development
#### Neurodiversity support
- Present: Well-structured content with clear headings
- Improve: Add summary boxes for key concepts
#### Representation
- Present: Neutral technical documentation
- Improve: Include diverse use case examples in future documentation
#### Psychological safety
- Present: Welcoming community comments and discussion
- Improve: Explicit encouragement for questions from developers at all skill levels
### โ
Logical Validity
#### Strong reasoning
- Deductive strength: Strong - if autoRegister is true and render_callback exists, then block registration succeeds
- Inductive strength: Good evidence from implementation example and community response
- Causal reasoning: Clear cause-effect relationship between PHP-only registration and reduced JavaScript requirements
#### Fallacies
- None identified in the technical documentation
#### Tone of voice
- Overall tone: Professional, informative, and encouraging to developers
### ๐ก๏ธ DARVO Analysis
- Deny: No denial patterns present in technical documentation
- Attack: No attacks on critics or alternative approaches
- Reverse victim/offender: Not applicable to technical content
- Emotional cues and rhetoric: Neutral technical presentation with positive community response
## ๐ฏ Conclusion
PHP-only block registration represents a significant step toward making WordPress block development more accessible to the broader PHP developer community. By eliminating JavaScript requirements for simple server-side blocks and automatically generating Inspector Controls, this feature removes a major barrier that has prevented many developers from creating custom blocks.
The enthusiastic community response suggests this addresses a real pain point in the WordPress ecosystem. While limitations exist around advanced input types, the foundation is solid for future enhancements that could make block development even more approachable for PHP-focused developers.
## ๐งฑ Refactor Appendix
### ๐ Literature Split Pad
### [H1] PHP-only blocks eliminate JavaScript requirements
> [!quote] [PHP-only block registration](https://make.wordpress.org/core/2026/03/03/php-only-block-registration/) by [[Miguel Fonseca]] via [[Make WordPress Core]]. Published 2026-03-03. Accessed 2024-12-19.
> "Developers can now create simple blocks using only PHP. This is meant for blocks that only need server-side rendering and aren't meant to be highly interactive."
Removes JavaScript barriers for server-side block development.
#wordpress #blocks
### [H2] autoRegister flag enables automatic editor integration
> [!quote] [PHP-only block registration](https://make.wordpress.org/core/2026/03/03/php-only-block-registration/)
> "These blocks will automatically appear in the editor without requiring any JavaScript registration, and the editor will automatically generate controls in the Inspector Controls sidebar."
Simplifies block registration workflow significantly.
#gutenberg #developer-experience
---
### ๐ Atomic Split Pad (Zettel Candidates)
#### [Z1] WordPress autoRegister reduces block development complexity
- Applies to simple server-side blocks without high interactivity needs
- Reference: WordPress 7.0 PHP-only registration feature
- Links: [[Block Development]] [[Server-Side Rendering]]
#### [Z2] Automatic control generation supports common attribute types
- Works for string, integer, boolean, and enum attributes with defaults
- Excludes local role attributes and unsupported types
- Links: [[Inspector Controls]] [[Block Attributes]]
---
### โ๏ธ Fleeting Queue
- [F1] Test autoRegister with different attribute combinations โ validate control generation #fleeting #wordpress
- [F2] Document missing input types like file uploads โ track enhancement requests #fleeting #blocks
- [F3] Create comparison guide for PHP-only vs JavaScript blocks โ help developers choose approach #fleeting #documentation
<!-- deep-read:sections end -->
๐ **Full text:** ![[Full Document Contents/Articles/PHP-only Block Registration|PHP-only Block Registration, make.wordpress.org]]
## Highlights
- Developers can now create simple blocks using only PHP. This is meant for blocks that only need server-side rendering and arenโt meant to be highly interactive.
To do so, call `register_block_type` with the new `autoRegister` flag. Note that a `render_callback` function must also be provided:
These blocks will automatically appear in the editor without requiring any JavaScript registration, and, wherever possible, the editor will automatically generate controls in the Inspector Controls sidebar to allow users to edit block attributes: ([View Highlight](https://read.readwise.io/read/01kjtnddmsvckey84nt3dz9q0a))