-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathplugin.php
More file actions
59 lines (52 loc) · 1.73 KB
/
Copy pathplugin.php
File metadata and controls
59 lines (52 loc) · 1.73 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
51
52
53
54
55
56
57
58
59
<?php
/**
* Plugin Name: Plugin Name
* Plugin URI: https://eighteen73.co.uk
* Update URI: https://eighteen73.co.uk
* Description: A brief description of the plugin.
* Version: 0.1.0
* Requires at least: 6.3
* Requires PHP: 7.4
* Requires Plugins:
* Author: eighteen73
* Author URI: https://eighteen73.co.uk
* Text Domain: eighteen73-plugin
* Domain Path: /languages
*
* License: GNU General Public License v3.0
* License URI: http://www.gnu.org/licenses/gpl-3.0.html
*
* @package Eighteen73\Eighteen73Plugin
*/
namespace Eighteen73\Eighteen73Plugin;
defined( 'ABSPATH' ) || exit;
// Useful global constants.
define( 'EIGHTEEN73_PLUGIN_URL', plugin_dir_url( __FILE__ ) );
define( 'EIGHTEEN73_PLUGIN_PATH', plugin_dir_path( __FILE__ ) );
define( 'EIGHTEEN73_PLUGIN_INC', EIGHTEEN73_PLUGIN_PATH . 'includes/' );
// Require the autoloader.
$autoloader = EIGHTEEN73_PLUGIN_PATH . '/vendor/autoload.php';
if ( file_exists( $autoloader ) ) {
require_once $autoloader;
} else {
add_action(
'admin_notices',
function () {
printf(
'<div class="notice notice-error"><p><strong>%s</strong>: %s</p></div>',
esc_html__( 'Plugin Name', 'eighteen73-plugin' ),
sprintf(
/* translators: %s: composer install command */
esc_html__( 'Composer dependencies not found. Please run %s to install required dependencies.', 'eighteen73-plugin' ),
'composer install'
)
);
}
);
return;
}
// Initialise the plugin.
Plugin::instance()->setup();
// Register activation and deactivation hooks.
register_activation_hook( __FILE__, [ Plugin::class, 'activation' ] );
register_deactivation_hook( __FILE__, [ Plugin::class, 'deactivation' ] );