-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathplugin.php
69 lines (62 loc) · 1.96 KB
/
plugin.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
<?php
/*
Plugin Name: WSU Scholarships
Version: 0.2.2
Description: A WordPress plugin for managing a collection of scholarships.
Author: washingtonstateuniversity, philcable
Author URI: https://web.wsu.edu/
Plugin URI: https://github.com/washingtonstateuniversity/WSUWP-Plugin-Scholarships
Text Domain: wsu-scholarships
*/
namespace WSU\Scholarships;
// If this file is called directly, abort.
if ( ! defined( 'WPINC' ) ) {
die;
}
// This plugin uses namespaces and requires PHP 5.3 or greater.
if ( version_compare( PHP_VERSION, '5.3', '<' ) ) {
add_action(
'admin_notices',
function() {
echo '<div class="error"><p>' . esc_html__( 'WSU Scholarships requires PHP 5.3 to function properly. Please upgrade PHP or deactivate the plugin.', 'wsu-scholarships' ) . '</p></div>';
}
);
return;
} else {
add_action( 'plugins_loaded', 'WSU\Scholarships\bootstrap' );
add_action( 'after_setup_theme', 'WSU\Scholarships\bootstrap_wds' );
/**
* Provide the plugin version for enqueued scripts and styles.
*
* @since 0.1.0
*
* @return string
*/
function plugin_version() {
return '0.2.1';
}
/**
* Starts things up.
*
* @since 0.1.0
*/
function bootstrap() {
include_once __DIR__ . '/includes/scholarship-post-type.php';
include_once __DIR__ . '/includes/scholarship-settings.php';
include_once __DIR__ . '/includes/scholarship-shortcodes.php';
include_once __DIR__ . '/includes/scholarship-contributor-role.php';
}
// load files associated with the Gutenberg WDS
function bootstrap_wds() {
if ( defined( 'ISWDS' ) ) {
include_once __DIR__ . '/includes/settings.php';
include_once __DIR__ . '/includes/scripts.php';
include_once __DIR__ . '/blocks/scholarships-search/block.php';
include_once __DIR__ . '/blocks/scholarships-list/block.php';
if ( 1 === (int) get_option( 'wsu_scholarships_plugin_enable_post_type', 0 ) ) {
include_once __DIR__ . '/includes/rest-api.php';
include_once __DIR__ . '/includes/page-template.php';
}
}
}
}