Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

πŸ§‘β€πŸ’» Make WordPress request handling opt-in & configurable #416

Merged
merged 11 commits into from
Dec 5, 2024

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