-
Notifications
You must be signed in to change notification settings - Fork 25
/
bootstrap.php
48 lines (38 loc) · 1.72 KB
/
bootstrap.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
<?php
/**
* Bootstrap the plugin if version check passed.
*
* @package @lasso
* @author Josh Pollock <[email protected]>
* @license GPL-2.0+
*/
/*----------------------------------------------------------------------------*
* Register Autoloader
*----------------------------------------------------------------------------*/
include_once( LASSO_DIR . '/includes/lasso_autoloader.php' );
$loader = new lasso_autoloader();
$loader->register();
/*----------------------------------------------------------------------------*
* Public-Facing Functionality
*----------------------------------------------------------------------------*/
//require_once plugin_dir_path( __FILE__ ) . 'public/class-lasso.php';
$loader->addNamespace('lasso', LASSO_DIR . 'includes' );
$loader->addNamespace('lasso_public_facing', LASSO_DIR . 'public/includes' );
$loader->addNamespace('lasso\internal_api', LASSO_DIR . 'internal-api' );
new lasso\internal_api\end_points();
register_activation_hook( __FILE__, array( 'lasso_public_facing\lasso', 'activate' ) );
register_deactivation_hook( __FILE__, array( 'lasso_public_facing\lasso', 'deactivate' ) );
add_action( 'plugins_loaded', array( 'lasso_public_facing\lasso', 'get_instance' ) );
//load tour
add_action( 'init', function() {
if (! is_admin() && is_user_logged_in() ) {
new \lasso_public_facing\tour();
}
});
/*----------------------------------------------------------------------------*
* Dashboard and Administrative Functionality
*----------------------------------------------------------------------------*/
if ( is_admin() ) {
$loader->addNamespace('lasso_admin', LASSO_DIR . 'admin/includes' );
add_action( 'plugins_loaded', array( 'lasso_admin\load_admin', 'get_instance' ) );
}