-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtips.php
More file actions
36 lines (31 loc) · 1021 Bytes
/
tips.php
File metadata and controls
36 lines (31 loc) · 1021 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
<?php //phpcs:disable Files.SideEffects.FoundWithSymbols
/**
* Plugin Name: TIPS
* Description: TIPS is plugin scaffolding.
* Plugin URI: https://alesc.dev
* Author: Al Esc
* Author URI: https://alesc.dev
* Version: 0.0.1
*
* @package al-esc\tips
*/
namespace Tips;
// Exit if accessed directly.
if (!defined('ABSPATH')) {
exit;
}
// Constant Definitions.
define('TIPS_PLUGIN_FILE', __FILE__);
define('TIPS_PLUGIN_DIR', plugin_dir_path(TIPS_PLUGIN_FILE));
define('TIPS_BASENAME', plugin_basename(TIPS_PLUGIN_FILE));
define('TIPS_PLUGIN_DIR_URL', plugin_dir_url(TIPS_PLUGIN_FILE));
define('TIPS_HANDLE', 'tips');
// Only require the autoload.php file if it exists.
// If it does not, assume that it is the root project's responsibility to load the necessary files.
call_user_func_array(function ($rootPath) {
$autoload = "{$rootPath}vendor/autoload.php";
if (is_readable($autoload)) {
require_once $autoload;
}
add_action('plugins_loaded', ['Tips\Plugin', 'getInstance'], -10);
}, [TIPS_PLUGIN_DIR]);