-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtransition-resources.php
114 lines (96 loc) · 3.64 KB
/
transition-resources.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
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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
<?php
/**
* Transition Resources
*
* Plugin Name: Transition Resources
* Description: Provides a Resources Directory for the Transition Network.
* Plugin URI: https://github.com/transitionnetwork/transition-resources
* GitHub Plugin URI: https://github.com/transitionnetwork/transition-resources
* Version: 1.0.0a
* Author: Transition Network
* Author URI: https://transitionnetwork.org/
* License: MIT
* License URI: https://opensource.org/license/MIT
* Requires at least: 6.5
* Requires PHP: 7.4
* Text Domain: transition-resources
* Domain Path: /languages
*
* @package Transition_Resources
* @link https://github.com/transitionnetwork/transition-resources
* @license MIT
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
// Exit if accessed directly.
defined( 'ABSPATH' ) || exit;
// Version.
define( 'TRANSITION_RESOURCES_VERSION', '1.0.0a' );
// Main plugin file.
if ( ! defined( 'TRANSITION_RESOURCES_FILE' ) ) {
define( 'TRANSITION_RESOURCES_FILE', __FILE__ );
}
// Plugin basename.
if ( ! defined( 'TRANSITION_RESOURCES_BASE' ) ) {
define( 'TRANSITION_RESOURCES_BASE', plugin_basename( TRANSITION_RESOURCES_FILE ) );
}
// Plugin path.
if ( ! defined( 'TRANSITION_RESOURCES_PATH' ) ) {
define( 'TRANSITION_RESOURCES_PATH', plugin_dir_path( TRANSITION_RESOURCES_FILE ) );
}
// Source path.
if ( ! defined( 'TRANSITION_RESOURCES_SRC' ) ) {
define( 'TRANSITION_RESOURCES_SRC', TRANSITION_RESOURCES_PATH . 'includes' );
}
// Plugin URL.
if ( ! defined( 'TRANSITION_RESOURCES_URL' ) ) {
define( 'TRANSITION_RESOURCES_URL', plugin_dir_url( TRANSITION_RESOURCES_FILE ) );
}
/**
* Gets a reference to this plugin.
*
* @since 1.0.0
*
* @return Transition_Resources\Plugin $plugin The plugin reference.
*/
function transition_resources() {
// Store plugin object in static variable.
static $plugin = false;
// Maybe bootstrap plugin.
if ( false === $plugin ) {
// Always include global functions files.
require_once trailingslashit( TRANSITION_RESOURCES_SRC ) . 'functions/functions-templates.php';
// Bootstrap autoloader.
require_once trailingslashit( TRANSITION_RESOURCES_SRC ) . 'class-autoloader.php';
$namespace = 'Transition_Resources';
$source_path = TRANSITION_RESOURCES_SRC;
new Transition_Resources\Autoloader( $namespace, $source_path );
// Bootstrap plugin.
$plugin = new Transition_Resources\Plugin();
}
// --<
return $plugin;
}
// Initialise plugin immediately.
transition_resources();
/*
* Uninstall uses the 'uninstall.php' method.
*
* @see https://developer.wordpress.org/reference/functions/register_uninstall_hook/
*/