-
Notifications
You must be signed in to change notification settings - Fork 0
/
timeline.php
42 lines (36 loc) · 1.21 KB
/
timeline.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
<?php
/**
* The plugin bootstrap file
*
* @wordpress-plugin
* Plugin Name: UT Dallas Research Timeline
* Plugin URI: https://github.com/utdallasresearch/utdresearch-timeline
* Description: A WordPress plugin for generating a custom-post-based timeline.
* Version: 1.0.5
* Author: UT Dallas Research Information Systems
* Author URI: https://research.utdallas.edu/oris
* License: MIT
* License URI: http://opensource.org/licenses/MIT
* Text Domain: timeline
* Domain Path: /languages
*/
define('Timeline\VERSION', '1.0.5');
// If this file is called directly, abort.
if (!defined('WPINC')) {
die;
}
// Autoload classes
spl_autoload_register(function ($class_name) {
$prefix = 'Timeline\\';
$prefix_length = strlen($prefix);
if (strncmp($prefix, $class_name, $prefix_length) !== 0) { // Only autoload Timeline classes
return;
}
$relative_class = substr($class_name, $prefix_length);
$filename = plugin_dir_path(__FILE__) . str_replace('\\', '/', $relative_class) . '.php';
if (file_exists($filename)) {
include_once $filename;
}
});
// Load the plugin
(new Timeline\TimelinePlugin())->load();