PHPackages                             juvo/wp-block-bridge - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. juvo/wp-block-bridge

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

juvo/wp-block-bridge
====================

Bridge WordPress blocks to page builders like Bricks and Elementor. Use blocks as the source of truth for styling, scripting, and render logic.

1.0.2(5mo ago)165[3 PRs](https://github.com/JUVOJustin/wp-block-bridge/pulls)GPL-3.0-or-laterPHPPHP &gt;=8.1.0CI passing

Since Jan 9Pushed 4mo agoCompare

[ Source](https://github.com/JUVOJustin/wp-block-bridge)[ Packagist](https://packagist.org/packages/juvo/wp-block-bridge)[ RSS](/packages/juvo-wp-block-bridge/feed)WikiDiscussions main Synced today

READMEChangelog (3)Dependencies (4)Versions (9)Used By (0)

WP Block Bridge
===============

[](#wp-block-bridge)

Use WordPress blocks as the source of truth for page builders like Bricks and Elementor.

Features
--------

[](#features)

- Render block templates in page builder elements
- Automatic asset enqueueing (script modules)
- Interactivity API directive processing
- Unified API for context and attributes across all render contexts
-

Requirements
------------

[](#requirements)

- PHP 8.1+
- Blocks must be registered using `block.json` metadata
- Blocks must be registered globally (e.g., via `register_block_type()` or `wp_register_block_types_from_metadata_collection()`)

Installation
------------

[](#installation)

```
composer require juvo/wp-block-bridge
```

Usage
-----

[](#usage)

### In render.php (Gutenberg + Page Builders)

[](#in-renderphp-gutenberg--page-builders)

```
use juvo\WP_Block_Bridge\Block_Bridge;

// Get context and attributes - works everywhere
$context    = Block_Bridge::context( $block ?? null );
$attributes = Block_Bridge::attributes( $block ?? null );

// Your block markup...
ob_start();
?>
