The Meta Box Blocks (MB Blocks) extension is a powerful tool for WordPress developers that allows for the creation of custom Gutenberg blocks using PHP only. It eliminates the need for JavaScript, React, or complex build tools like Webpack.
The Meta Box Blocks (MB Blocks) extension is a powerful tool for WordPress developers that allows for the creation of custom Gutenberg blocks using PHP only. It eliminates the need for JavaScript, React, or complex build tools like Webpack.
This is EXACTLY the same product as distributed by the developer. Sales Page
WordPress Version: 6.5 or higher (for the latest stable releases).
PHP Version: 7.1 or higher (PHP 7.4+ recommended for security and performance).
Core Plugin: Requires the Meta Box (free) framework to be active.
License: This is a premium extension available as part of the Meta Box AIO or individual purchase.
No JavaScript Required: Register and render blocks entirely through PHP.
Registration Standard: Fully supports the WordPress block.json standard for registration.
Rendering Methods:
PHP Callback: Use a function to render the block’s HTML.
Template File: Assign a specific PHP file to handle the block’s output.
MB Views: Integration with the MB Views extension allows for UI-based template building using Twig syntax.
Data Storage: Saves data as block attributes by default (stored within the post content) rather than post meta, though it can be configured to interact with post meta via helper functions.
| Feature | Description |
| Field Types | Supports all 40+ Meta Box fields (text, image, group, color picker, etc.). |
| Full Site Editing (FSE) | Fully compatible with block-based themes and the Site Editor. |
| Server-Side Rendering | Blocks are rendered on the server, ensuring SEO-friendly HTML and faster initial loads. |
| Preview Support | Real-time preview within the Gutenberg editor while editing field values. |
| Asset Management | Easily enqueue specific CSS or JS files only when the block is present on the page. |
To create a block, you typically register a “Field Group” and set its location to Block.
When using a render_template or render_callback, the plugin provides four key variables:
$attributes: The data entered into the block fields.
$is_preview: Boolean to check if the block is being viewed in the editor.
$post_id: The ID of the post the block is attached to.
$block: The full block object (instance of WP_Block).
Lightweight: It only loads the necessary logic for the specific blocks used on a page.
Developer Efficiency: Reduces block development time by roughly 80% compared to native React-based development.
Modular: Since it’s part of the Meta Box ecosystem, it integrates seamlessly with MB Custom Table for high-performance data handling.