PHPackages                             desert-dionysus/inertia-wordpress - 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. [API Development](/categories/api)
4. /
5. desert-dionysus/inertia-wordpress

ActiveLibrary[API Development](/categories/api)

desert-dionysus/inertia-wordpress
=================================

The modernized WordPress adapter for Inertia.js v2.0

v1.0.2(5mo ago)10MITPHPPHP &gt;=8.2

Since Jan 17Pushed 5mo agoCompare

[ Source](https://github.com/desert-dionysus/inertia-wordpress)[ Packagist](https://packagist.org/packages/desert-dionysus/inertia-wordpress)[ RSS](/packages/desert-dionysus-inertia-wordpress/feed)WikiDiscussions master Synced today

READMEChangelogDependenciesVersions (4)Used By (0)

Inertia.js WordPress Adapter (Modernized Fork)
==============================================

[](#inertiajs-wordpress-adapter-modernized-fork)

A modernized [Inertia.js](https://inertiajs.com) server-side adapter for WordPress, aligned with Inertia.js v2.0+ protocol.

> **Note**: This is a fork of the excellent work by [Andrew Rhyand (BoxyBird)](https://github.com/boxybird/inertia-wordpress). While the core philosophy remains the same, this version has been modernized for PHP 8.2+ and adds support for the latest Inertia.js features like Deferred Props, Merge Props, and more.

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

[](#installation)

Install the package via composer:

```
composer require desert-dionysus/inertia-wordpress
```

Acknowledgements &amp; Resources
--------------------------------

[](#acknowledgements--resources)

This project is a fork of `boxybird/inertia-wordpress`. We highly recommend checking out Andrew's original work and examples:

- **Original Repository**: [boxybird/inertia-wordpress](https://github.com/boxybird/inertia-wordpress)
- **Example Movie CPT Project**: [Theme Repository](https://github.com/boxybird/wordpress-inertia-demo-theme) | [Demo Site](https://wp-inertia.andrewrhyand.com)

Root Template Example
---------------------

[](#root-template-example)

> Location: `/wp-content/themes/your-theme/app.php` (or `layout.php`)

```
DOCTYPE html>

```

The `inertia()` Helper
----------------------

[](#the-inertia-helper)

This fork introduces a global `inertia()` helper function that provides a fluent API similar to Laravel's adapter.

```
// Render a component
return inertia('Index', ['posts' => $posts]);

// Chainable methods
return inertia()
    ->version('1.0.0')
    ->share('key', 'value')
    ->render('Index', $props);
```

Core Features
-------------

[](#core-features)

### Inertia Responses

[](#inertia-responses)

```
use DesertDionysus\Inertia\Inertia;

// Using the Class
return Inertia::render('Posts/Index', [
    'posts' => $posts,
]);

// Or using the helper
return inertia('Posts/Index', [
    'posts' => $posts,
]);
```

### Shared Data

[](#shared-data)

Shared data is automatically included in every Inertia response.

```
inertia()->share('site_name', get_bloginfo('name'));

// Shared Closures are only executed if they are included in the response
inertia()->share('auth', function () {
    return is_user_logged_in() ? wp_get_current_user() : null;
});
```

### Always Props (v2.0)

[](#always-props-v20)

Props wrapped in `always()` will be included in every response, even during partial reloads where they weren't specifically requested.

```
return inertia('Profile', [
    'user' => $user,
    'social_links' => Inertia::always($links),
]);
```

### Deferred Props (v2.0)

[](#deferred-props-v20)

Deferred props allow you to load heavy data asynchronously after the initial page load.

```
return inertia('Dashboard', [
    'stats' => Inertia::defer(fn() => get_heavy_stats()),
    'logs'  => Inertia::defer(fn() => get_logs(), 'activity-group'),
]);
```

### Merge Props (v2.0)

[](#merge-props-v20)

Useful for infinite scrolling or pagination.

```
return inertia('Blog', [
    'posts' => Inertia::merge(fn() => get_next_page_posts()),
]);
```

### External Redirects

[](#external-redirects)

Handles full-page redirects, even during Inertia AJAX requests.

```
return Inertia::location('https://external-site.com');
```

WordPress Integration
---------------------

[](#wordpress-integration)

### Automatic Nonce Injection

[](#automatic-nonce-injection)

This adapter automatically includes a `wp_rest` nonce in every response under the `nonce` prop, simplifying CSRF protection for your API calls.

### Flash Messages &amp; Validation Errors

[](#flash-messages--validation-errors)

Easily pass flash messages or validation errors that will be automatically shared via the `flash` and `errors` props.

```
// In your "Controller"
inertia()->flash('success', 'Post updated!');
inertia()->withErrors(['title' => 'Title is required']);

return Inertia::location(get_permalink($post_id));
```

### Asset Versioning

[](#asset-versioning)

```
// Automatically version from Vite manifest
Inertia::versionFromVite(get_stylesheet_directory() . '/dist/manifest.json');

// Or from any specific file
Inertia::versionFromFile(get_stylesheet_directory() . '/style.css');

// Or manually
Inertia::version('v1.2.3');
```

Configuration
-------------

[](#configuration)

### Root Template File Override

[](#root-template-file-override)

```
add_action('init', function () {
    Inertia::setRootView('layout.php');
});
```

---

Inertia Docs
------------

[](#inertia-docs)

- [Links](https://inertiajs.com/links)
- [Pages](https://inertiajs.com/pages)
- [Requests](https://inertiajs.com/requests)
- [Shared Data](https://inertiajs.com/shared-data)
- [Asset Versioning](https://inertiajs.com/asset-versioning)
- [Partial Reloads](https://inertiajs.com/partial-reloads)
- [Deferred Props](https://inertiajs.com/deferred-props)
- [Merge Props](https://inertiajs.com/merge-props)

###  Health Score

34

—

LowBetter than 75% of packages

Maintenance70

Regular maintenance activity

Popularity2

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity49

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 86.7% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~0 days

Total

3

Last Release

167d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/6b383e1e1ec68286c79e52113c755ba4b44b3b55733c7b8b9aa82773a41f97b0?d=identicon)[DesertDionysus](/maintainers/DesertDionysus)

---

Top Contributors

[![boxybird](https://avatars.githubusercontent.com/u/18317878?v=4)](https://github.com/boxybird "boxybird (52 commits)")[![desert-dionysus](https://avatars.githubusercontent.com/u/4343379?v=4)](https://github.com/desert-dionysus "desert-dionysus (4 commits)")[![patlamontagne](https://avatars.githubusercontent.com/u/16765115?v=4)](https://github.com/patlamontagne "patlamontagne (2 commits)")[![alexstewartja](https://avatars.githubusercontent.com/u/6935309?v=4)](https://github.com/alexstewartja "alexstewartja (1 commits)")[![Tofandel](https://avatars.githubusercontent.com/u/6115458?v=4)](https://github.com/Tofandel "Tofandel (1 commits)")

---

Tags

pluginwordpressreactinertiajsvue

### Embed Badge

![Health badge](/badges/desert-dionysus-inertia-wordpress/health.svg)

```
[![Health](https://phpackages.com/badges/desert-dionysus-inertia-wordpress/health.svg)](https://phpackages.com/packages/desert-dionysus-inertia-wordpress)
```

###  Alternatives

[sybrew/the-seo-framework

An automated, advanced, accessible, unbranded and extremely fast SEO solution for any WordPress website.

47884.4k](/packages/sybrew-the-seo-framework)[imranhsayed/headless-cms

A WordPress plugin that adds features to use WordPress as a headless CMS with any front-end environment using REST API

2125.1k](/packages/imranhsayed-headless-cms)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
