Search by

tombroucke / acorn-wpml-livewire-fix

tombroucke

Prevents WPML from appending the language path to home_url() when Acorn sets the Laravel root URL, fixing broken Livewire asset and update URLs on translated pages.

Package info

github.com/tombroucke/acorn-wpml-livewire-fix

Type:wordpress-muplugin

pkg:composer/tombroucke/acorn-wpml-livewire-fix

Statistics

Installs: 9

Dependents: 0

Suggesters: 0

Stars: 0

Open Issues: 0

1.0.0 2026-10-09 09:36 UTC

This package is auto-updated.

Last update: 2026-10-09 09:41:00 UTC


README

Fixes broken Livewire asset and update URLs when using WPML (or TranslatePress) with Acorn v5.1+.

The problem

Acorn calls URL::forceRootUrl(home_url()) to set the Laravel root URL. WPML filters home_url() to append the current language prefix (e.g. /fr), causing:

  • livewire.js to 404
  • /livewire/update to contain the language segment repeated 3× (e.g. https://example.com/fr/fr/fr/livewire/update)

Installation

1. Require the package:

composer require tombroucke/acorn-wpml-livewire-fix

2. Patch Acorn (until roots/acorn#570 is merged):

Add to composer.json:

"require": {
    "cweagans/composer-patches": "^2.0"
},
"config": {
    "allow-plugins": {
        "cweagans/composer-patches": true
    }
},
"extra": {
    "patches": {
        "roots/acorn": [
            {
                "description": "Add do_action hooks around URL::forceRootUrl for WPML compatibility",
                "url": "https://patch-diff.githubusercontent.com/raw/roots/acorn/pull/570.patch"
            }
        ]
    }
}

Then apply:

composer reinstall roots/acorn