-
Notifications
You must be signed in to change notification settings - Fork 2
/
tm-timeline.php
99 lines (83 loc) · 2.36 KB
/
tm-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
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
<?php
/**
* Plugin Name: TM Timeline
* Plugin URI: https://wordpress.org/plugins/tm-timeline/
* Description: This plugin allows users to build their own timelines
* Author: Jetimpex
* Author URI: https://jetimpex.com/wordpress/
* Text Domain: tm-timeline
* License: GPL-3.0+
* License URI: http://www.gnu.org/licenses/gpl-3.0.txt
* Version: 1.1.1
* Domain Path: /languages
*
* @package Timeline
* @author Template Monster
* @license GPL-3.0+
* @copyright 2017 Template Monster
*/
defined( 'ABSPATH' ) or die( 'No script kiddies please!' );
define( 'TM_TIMELINE_VERSION', '1.1.1' );
add_action( 'plugins_loaded', 'tm_timeline_lang', 1 );
add_action( 'plugins_loaded', 'tm_timeline_init', 2 );
add_action( 'plugins_loaded', 'tm_timeline_init_admin', 3 );
register_activation_hook( __FILE__, 'tm_timeline_activate' );
register_deactivation_hook( __FILE__, 'tm_timeline_deactivate' );
/**
* Timeline plugin main file.
*/
require dirname( __FILE__ ) . DIRECTORY_SEPARATOR . 'functions.php';
if ( ! function_exists( 'tm_timeline_lang' ) ) {
/**
* Load translations.
*/
function tm_timeline_lang() {
load_plugin_textdomain( 'tm-timeline', false, dirname( plugin_basename( __FILE__ ) ) . '/languages' );
}
}
if ( ! function_exists( 'tm_timeline_init' ) ) {
/**
* Plugin initialization callback.
*/
function tm_timeline_init() {
// Load class if it's not initialized yet.
if ( ! class_exists( 'Tm_Timeline' ) ) {
require tm_timeline_plugin_path( 'classes/class-tm-timeline.php' );
}
// Initialize plugin frontend.
Tm_Timeline::initialize();
}
}
if ( ! function_exists( 'tm_timeline_init_admin' ) ) {
/**
* Plugin admin initialization callback.
*/
function tm_timeline_init_admin() {
// Prevent non admin access.
if ( ! is_admin() ) {
return;
}
// Load class if it's not initialized yet.
if ( ! class_exists( 'Tm_Timeline_Admin' ) ) {
require tm_timeline_plugin_path( 'admin/classes/class-tm-timeline-admin.php' );
}
// Initialize plugin admin.
Tm_Timeline_Admin::initialize();
}
}
if ( ! function_exists( 'tm_timeline_activate' ) ) {
/**
* Plugin activation callback.
*/
function tm_timeline_activate() {
flush_rewrite_rules();
}
}
if ( ! function_exists( 'tm_timeline_deactivate' ) ) {
/**
* Plugin deactivation callback.
*/
function tm_timeline_deactivate() {
flush_rewrite_rules();
}
}