-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathplugin.php
More file actions
50 lines (45 loc) · 1.26 KB
/
Copy pathplugin.php
File metadata and controls
50 lines (45 loc) · 1.26 KB
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
38
39
40
41
42
43
44
45
46
47
48
49
50
<?php
/**
* Plugin Name: Gutenberg Fnugg Whether Block
* Description: Provides a Gutenberg block presents data from a ski resort using the Fnugg API.
* Version: 0.0.0
* Author: Denis Alemán
* License: MIT
* Text Domain: gutenberg-fnugg-whether-block
* Namespace: Dekode\FnuggWhetherPlugin
*/
// Silence is golden.
declare( strict_types = 1 );
/**
* Define the default root file of the plugin
*
* @since 0.0.0
*/
const DEKODE_FNUGG_PLUGIN_FILE = __FILE__;
/**
* Load PSR4 autoloader
*
* @since 0.0.0
*/
$dekode_fnugg_autoloader = require plugin_dir_path( DEKODE_FNUGG_PLUGIN_FILE ) . 'vendor/autoload.php';
/**
* Bootstrap the plugin
*
* @since 0.0.0
*/
if ( ! class_exists( 'Dekode\FnuggWhetherPlugin\Bootstrap' ) ) {
wp_die( __( 'Dekode Gutenberg Blocks is unable to find the Bootstrap class.', 'gutenberg-fnugg-whether-block' ) );
}
add_action(
'plugins_loaded',
static function () use ( $dekode_fnugg_autoloader ) {
/**
* @see \Dekode\FnuggWhetherPlugin\Bootstrap
*/
try {
new \Dekode\FnuggWhetherPlugin\Bootstrap( $dekode_fnugg_autoloader );
} catch ( Exception $e ) {
wp_die( __( 'Dekode Gutenberg Blocks is unable to run the Bootstrap class.', 'gutenberg-fnugg-whether-block' ) );
}
}
);