-
Notifications
You must be signed in to change notification settings - Fork 19
Expand file tree
/
Copy pathsb-app-integration.php
More file actions
65 lines (50 loc) · 1.51 KB
/
sb-app-integration.php
File metadata and controls
65 lines (50 loc) · 1.51 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
<?php
/**
* Plugin Name: SB App Integration
* Plugin URI: http://scottbolinger.com
* Description: Integrate WordPress with your mobile app. Login, post list images, and more.
* Version: 0.1
* Author: Scott Bolinger
* Author URI: http://scottbolinger.com
*
* @author Scott Bolinger
* @copyright Copyright (c) Scott Bolinger 2018
*
*/
// Exit if accessed directly
if( !defined( 'ABSPATH' ) ) exit;
if( !class_exists( 'SB_App_Integration' ) ) {
class SB_App_Integration {
private static $instance;
public static function instance() {
if ( self::$instance === null ) {
self::$instance = new self();
self::$instance->includes();
}
return self::$instance;
}
/**
* Include necessary files
*
* @access private
* @since 0.1.0
* @return void
*/
private function includes() {
require_once plugin_dir_path( __FILE__ ) . 'inc/class-wpapi-login.php';
require_once plugin_dir_path( __FILE__ ) . 'inc/class-wpapi-mods.php';
require_once plugin_dir_path( __FILE__ ) . 'inc/class-sb-woocommerce.php';
}
}
} // End if class_exists check
/**
* The main function responsible for returning the instance
*
* @since 0.1.0
* @return SB_App_Integration::instance()
*
*/
function sb_app_integration_load() {
return SB_App_Integration::instance();
}
add_action( 'plugins_loaded', 'sb_app_integration_load' );