-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbootstrap.php
More file actions
37 lines (29 loc) · 968 Bytes
/
Copy pathbootstrap.php
File metadata and controls
37 lines (29 loc) · 968 Bytes
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
35
36
37
<?php
/**
* Shared bootstrap (no plugin header).
*
* @package PersonaPress
*/
declare(strict_types=1);
namespace PersonaPress;
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
if ( ! file_exists( __DIR__ . '/vendor/autoload.php' ) ) {
add_action( 'admin_notices', static function () {
echo '<div class="notice notice-error"><p>'
. esc_html__( 'PersonaPress: Composer dependencies are missing. Please run `composer install`.', 'personapress' )
. '</p></div>';
} );
return;
}
require_once __DIR__ . '/src/helpers.php';
require_once __DIR__ . '/vendor/autoload.php';
function personapress_init(): void {
Installer::maybe_upgrade();
$plugin = Plugin::instance();
$plugin->boot();
}
add_action( 'plugins_loaded', 'PersonaPress\\personapress_init' );
register_activation_hook( PP_PLUGIN_FILE, [ Installer::class, 'activate' ] );
register_deactivation_hook( PP_PLUGIN_FILE, [ Installer::class, 'deactivate' ] );