-
Notifications
You must be signed in to change notification settings - Fork 0
/
functions.php
34 lines (27 loc) · 1.03 KB
/
functions.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
<?php
use Sitepilot\Framework\Foundation\Application;
if (!defined('ABSPATH')) exit;
require __DIR__ . '/vendor/autoload.php';
if (!class_exists(Application::class)) {
return add_action('admin_notices', function () {
echo '<div class="notice notice-error"><p>You need to install <a href="https://github.com/sitepilot/sitepilot" target="_blank">Sitepilot</a> to use the activated theme.</p></div>';
});
}
new Application(basename(__DIR__), __FILE__, [
// Theme service providers
\Sitepilot\Theme\Providers\ThemeServiceProvider::class,
\Sitepilot\Theme\Providers\BlocksServiceProvider::class,
\Sitepilot\Theme\Providers\OptionsServiceProvider::class,
// Package service providers
\Sitepilot\WpTheme\Acf\AcfServiceProvider::class,
\Sitepilot\WpTheme\Post\PostServiceProvider::class,
\Sitepilot\WpTheme\Element\ElementServiceProvider::class
]);
if (!function_exists('sp_theme')) {
function sp_theme(): ?Application
{
return Application::app(
basename(__DIR__)
);
}
}