Skip to content

Conversation

Log1x
Copy link
Member

@Log1x Log1x commented Dec 5, 2024

For the actual release of v5 we have decided to make the WordPress request handler opt-in. By default, it will be enabled in Sage 10 once that is updated.

Example:

use Roots\Acorn\Application;

Application::configure()
    ->withProviders([
        App\Providers\ThemeServiceProvider::class,
    ])
    ->withRouting(wordpress: true)
    ->boot();

With this, WordPress now uses its own wordpress middleware group (which is a copy of default web) and should allow more fine-grained control.

Removing a default middleware from the WordPress group might look something like:

use Roots\Acorn\Application;
use Roots\Acorn\Configuration\Middleware;

Application::configure()
    ->withProviders([
        App\Providers\ThemeServiceProvider::class,
    ])
    ->withRouting(wordpress: true)
    ->withMiddleware(function (Middleware $middleware) {
        $middleware->wordpress(remove: [
            Illuminate\Session\Middleware\StartSession::class,
            Illuminate\View\Middleware\ShareErrorsFromSession::class,
        ]);
    })
    ->boot();

@Log1x Log1x merged commit 88096b5 into main Dec 5, 2024
1 check passed
@Log1x Log1x deleted the enhance/415 branch December 5, 2024 20:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants