forked from godaddy-wordpress/wp-stock-photos
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathstock-photos.php
67 lines (42 loc) · 1.25 KB
/
stock-photos.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
<?php
/**
* Plugin Name: Stock Photos
* Description: Import beautiful, curated stock photos for your website
* Author: GoDaddy
* Version: 1.0.0
* Text Domain: stock-photos
* Domain Path: /languages
*/
namespace WPaaS\StockPhotos;
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
require 'includes/class-ajax.php';
require 'includes/class-api.php';
require 'includes/class-import.php';
require 'includes/class-scripts.php';
class Plugin {
const FILE = __FILE__;
public static function instance() {
if ( ! is_callable( '\WPaaS\Plugin::is_wpaas' ) || ! \WPaaS\Plugin::is_wpaas() ) {
return;
}
static $instance = null;
if ( ! is_null( $instance ) ) {
return $instance;
}
$composer_autoloader = __DIR__ . '/vendor/autoload.php';
if ( defined( 'WP_CLI' ) && WP_CLI && file_exists( $composer_autoloader ) ) {
// This is for enabling codeception
require_once $composer_autoloader;
}
load_plugin_textdomain( 'stock-photos', false, dirname( plugin_basename( __FILE__ ) ) . '/languages' );
$api = new API();
$scripts = new Scripts( $api );
$import = new Import();
$ajax = new Ajax( $api, $import );
$instance = new self;
return $instance;
}
}
add_action( 'plugins_loaded', 'WPaaS\StockPhotos\Plugin::instance' );