WP Manifestindependent plugin directory
manifest / developer / acorn-wpml-livewire-fix

Acorn WPML Livewire Fix

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.

★ 0stars

Install

Download source zip No release zip yet

This is the repository archive. It installs, but the folder name will carry the branch suffix and updates will not flow.

Install straight from GitHub with WP-CLI:

wp plugin install https://github.com/tombroucke/acorn-wpml-livewire-fix/archive/refs/heads/main.zip
No built-in updater. New versions won't appear under Dashboard → Updates. Install new releases yourself, or let Git Updater track the repository.

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