-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathwp-plugin-base.php
More file actions
37 lines (30 loc) · 1.1 KB
/
wp-plugin-base.php
File metadata and controls
37 lines (30 loc) · 1.1 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
<?php
namespace Mindsize\WP_Plugin_Base;
/**
* Plugin Name: WordPress Plugin Base
* Description: This is a sample plugin that was created with mindsize/wp-plugin-base
* Author: Mindsize
* Author URI: http://mindsize.me
* Version: 1.0.0
* Requires at least: 4.4
* Tested up to: 4.8
*/
define( 'WP_PLUGIN_BASE_VERSION', '1.0.0' );
define( 'WP_PLUGIN_BASE_SLUG', 'wp-plugin-base' );
define( 'WP_PLUGIN_BASE_FILE', __FILE__ );
define( 'WP_PLUGIN_BASE_DIR', plugin_dir_path( WP_PLUGIN_BASE_FILE ) );
define( 'WP_PLUGIN_BASE_URL', plugin_dir_url( WP_PLUGIN_BASE_FILE ) );
if ( file_exists( WP_PLUGIN_BASE_DIR . 'vendor/autoload_52.php' ) ) {
require_once WP_PLUGIN_BASE_DIR . 'vendor/autoload_52.php';
}
function wp_plugin_base() {
if ( ! class_exists( __NAMESPACE__ . '\\WP_Plugin_Factory' ) ) {
throw new \Exception( __NAMESPACE__ . '\\WP_Plugin_Factory class cannot be found.' );
}
return WP_Plugin_Factory::create();
}
function load_plugin() {
$instance = wp_plugin_base();
$instance->init();
}
add_action( 'plugins_loaded', __NAMESPACE__ . '\\load_plugin' );