1: <?php
2: /*
3: Plugin Name: Sensei
4: Plugin URI: http://www.woothemes.com/products/sensei/
5: Description: A course management plugin that offers the smoothest platform for helping you teach anything.
6: Version: 1.9.6
7: Author: WooThemes
8: Author URI: http://www.woothemes.com/
9: License: GPL version 2 or later - http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
10: Requires at least: 4.1
11: Tested up to: 4.5
12: Text Domain: woothemes-sensei
13: Domain path: /lang/
14: */
15: /* Copyright 2013 WooThemes (email : info@woothemes.com)
16:
17: This program is free software; you can redistribute it and/or modify
18: it under the terms of the GNU General Public License, version 2, as
19: published by the Free Software Foundation.
20:
21: This program is distributed in the hope that it will be useful,
22: but WITHOUT ANY WARRANTY; without even the implied warranty of
23: MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
24: GNU General Public License for more details.
25:
26: You should have received a copy of the GNU General Public License
27: along with this program; if not, write to the Free Software
28: Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
29: */
30:
31: if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
32:
33: require_once( 'includes/class-sensei-autoloader.php' );
34: require_once( 'includes/lib/woo-functions.php' );
35: require_once( 'includes/sensei-functions.php' );
36:
37: if ( ! is_admin() ) {
38: require_once( 'includes/template-functions.php' );
39: }
40:
41: /**
42: * Returns the global Sensei Instance.
43: *
44: * @since 1.8.0
45: */
46: function Sensei(){
47:
48: return Sensei_Main::instance();
49:
50: }
51:
52: // set the sensei version number
53: Sensei()->version = '1.9.6';
54:
55: //backwards compatibility
56: global $woothemes_sensei;
57: $woothemes_sensei = Sensei();
58:
59: /**
60: * Hook in WooCommerce functionality
61: */
62: add_action('init', array( 'Sensei_WC', 'load_woocommerce_integration_hooks' ) );
63:
64: /**
65: * Load all Template hooks
66: */
67: if(! is_admin() ){
68:
69: require_once( 'includes/hooks/template.php' );
70:
71: }
72:
73: /**
74: * Plugin updates
75: * @since 1.0.1
76: */
77: woothemes_queue_update( plugin_basename( __FILE__ ), 'bad2a02a063555b7e2bee59924690763', 152116 );
78:
79: /**
80: * Sensei Activation Hook registration
81: * @since 1.8.0
82: */
83: register_activation_hook( __FILE__, 'activate_sensei' );
84:
85: /**
86: * Activate_sensei
87: *
88: * All the activation checks needed to ensure Sensei is ready for use
89: * @since 1.8.0
90: */
91: function activate_sensei () {
92:
93: // create the teacher role on activation and ensure that it has all the needed capabilities
94: Sensei()->teacher->create_role();
95:
96: //Setup all the role capabilities needed
97: Sensei()->updates->add_sensei_caps();
98: Sensei()->updates->add_editor_caps();
99: Sensei()->updates->assign_role_caps();
100:
101: //Flush rules
102: add_action( 'activated_plugin' , array( 'Sensei_Main','activation_flush_rules' ), 10 );
103:
104: //Load the Welcome Screen
105: add_action( 'activated_plugin' , array( 'Sensei_Welcome','redirect' ), 20 );
106:
107: }// end activate_sensei
108: