-
Notifications
You must be signed in to change notification settings - Fork 10
/
Copy pathsimple-course-creator.php
110 lines (91 loc) · 3.12 KB
/
simple-course-creator.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
<?php
/**
* Plugin Name: Simple Course Creator
* Plugin URI: https://github.com/SDavisMedia/simple-course-creator
* Description: Allows you to easily create and manage courses in your WordPress website.
* Version: 1.0.7
* Author: Sean Davis
* Author URI: https://github.com/SDavisMedia/
* License: GPL2
* Requires at least: 3.8
* Tested up to: 5.3
* Text Domain: scc
* Domain Path: /languages/
*
* This plugin is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License, version 2, as
* published by the Free Software Foundation.
*
* This plugin is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, see http://www.gnu.org/licenses/.
*
* The basic foundation of this plugin was highly influenced by Mike
* Jolley's WP Post Series plugin. Special thanks to him. Check out
* his website - http://mikejolley.com -
*
* @package Simple Course Creator
* @category Core
* @author Sean Davis
* @license GNU GENERAL PUBLIC LICENSE Version 2 - /license.txt
*/
if ( ! defined( 'ABSPATH' ) ) exit; // no accessing this file directly
/**
* primary class for Simple Course Creator
*
* @since 1.0.0
*/
class Simple_Course_Creator {
/**
* constructor for Simple_Course_Creator class
*
* Set up the basic plugin environment and with definitions,
* plugin information, and required plugin files.
*/
public function __construct() {
// define plugin name
define( 'SCC_NAME', 'Simple Course Creator' );
// define plugin version
define( 'SCC_VERSION', '1.0.7' );
// define plugin directory
define( 'SCC_DIR', trailingslashit( plugin_dir_path( __FILE__ ) ) );
// define plugin root file
define( 'SCC_URL', trailingslashit( plugin_dir_url( __FILE__ ) ) );
// load text domain
add_action( 'init', array( $this, 'load_textdomain' ) );
// load admin scripts and styles
add_action( 'admin_enqueue_scripts', array( $this, 'admin_assets' ) );
// require additional plugin files
$this->includes();
}
/**
* load SCC textdomain
*/
public function load_textdomain() {
load_plugin_textdomain( 'scc', false, SCC_DIR . 'languages/' );
}
/**
* enqueue *back-end* scripts and styles
*/
public function admin_assets() {
// admin page CSS
wp_register_style( 'scc_admin_style', SCC_URL . 'assets/css/admin-style.css' );
// only load styles on SCC admin pages
if ( 'settings_page_simple_course_creator' == get_current_screen()->id ) {
wp_enqueue_style( 'scc_admin_style' );
}
}
/**
* require additional plugin files
*/
private function includes() {
require_once( SCC_DIR . 'includes/admin/class-scc-settings-page.php' ); // main settings page
require_once( SCC_DIR . 'includes/admin/class-scc-custom-taxonomy.php' ); // setup course taxonomy
require_once( SCC_DIR . 'includes/display/class-scc-post-listing.php' ); // display post listing
}
}
new Simple_Course_Creator();