-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathplugin.php
More file actions
79 lines (67 loc) · 2.29 KB
/
plugin.php
File metadata and controls
79 lines (67 loc) · 2.29 KB
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
<?php namespace WPDC_Learndash;
/**
* Custom LearnDash extension for WPDC
*
* @package WPDC_Learndash
* @author WPDevelopersClub and hellofromTonya
* @license GPL-2.0+
* @link http://wpdevelopersclub.com/
* @copyright 2015 WP Developers Club
*
* @wordpress-plugin
* Plugin Name: Custom LearnDash extension for WPDC
* Plugin URI: http://wpdevelopersclub.com/
* Description: Configuring LearnDash for our needs
* Version: 2.1.0
* Author: WP Developers Club and Tonya
* Author URI: http://wpdevelopersclub.com
* Text Domain: wpdevsclub
* Requires WP: 3.5
* Requires PHP: 5.4
*/
/*
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.
This program 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, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
use WPDevsClub_Core\Config\Factory;
// Oh no you don't. Exit if accessed directly
if ( ! defined( 'ABSPATH' ) ) {
exit( 'Cheating’ uh?' );
}
if ( ! defined( 'WPDC_LEARNDASH_PLUGIN_DIR' ) ) {
define( 'WPDC_LEARNDASH_PLUGIN_DIR', plugin_dir_path( __FILE__ ) );
}
if ( ! defined( 'WPDC_LEARNDASH_PLUGIN_URL' ) ) {
$plugin_url = plugin_dir_url( __FILE__ );
if ( is_ssl() ) {
$plugin_url = str_replace( 'http://', 'https://', $plugin_url );
}
define( 'WPDC_LEARNDASH_PLUGIN_URL', $plugin_url );
}
require_once( __DIR__ . '/assets/vendor/autoload.php' );
add_action( 'plugins_loaded', __NAMESPACE__ . '\\launch' );
/**
* Launch the plugin
*
* @since 1.1.0
*
* @return null
*/
function launch() {
if ( ! class_exists( 'SFWD_LMS' ) ) {
return;
}
if ( version_compare( $GLOBALS['wp_version'], Plugin::MIN_WP_VERSION, '>' ) ) {
$config = Factory::create( WPDC_LEARNDASH_PLUGIN_DIR . 'config/plugin.php' );
new Plugin( $config );
}
}