Files
WP-Acorn-Starter/bootstrap.php
2026-02-16 18:37:29 +01:00

43 lines
1.0 KiB
PHP

<?php
use Illuminate\Foundation\Configuration\Middleware;
use Illuminate\Foundation\Http\Middleware\ValidateCsrfToken;
use Illuminate\Support\Facades\Blade;
use Roots\Acorn\Application;
include_once 'vendor/autoload.php';
// Plugin requires WP Acorn
if (! class_exists( Application::class)) {
wp_die(
__('You need to install Acorn to use this site.', 'domain'),
'',
[
'link_url' => 'https://roots.io/acorn/docs/installation/',
'link_text' => __('Acorn Docs: Installation', 'domain'),
]
);
}
add_action('after_setup_theme', function () {
Application::configure()
->withProviders([
])
->withMiddleware(function (Middleware $middleware) {
})
->withRouting(wordpress: true)
->boot();
}, 0);
// Insert code injection to the document head
add_action('wp_head', function () {
echo view('injections.head')->render();
});
// Insert code injection to the document footer
add_action('wp_footer', function () {
echo view('injections.footer')->render();
});