-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathwp-plugin-template.php
60 lines (50 loc) · 1.7 KB
/
wp-plugin-template.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
<?php
/**
* Plugin Name: WP Plugin Template
* Version: 0.1.0
* Plugin URI: https://github.com/Monogramm/wp-plugin-template/
* Description: WP Plugin Template with Unit Tests and docker env
* Author: Monogramm
* Author URI: http://www.monogramm.io/
* Requires at least: 5.2
* Tested up to: 5.6
*
* Text Domain: wp-plugin-template
* Domain Path: /lang/
*
* @package WordPress
* @author Monogramm
* @since 0.1.0
*/
if ( ! defined( 'ABSPATH' ) ) {
die;
}
// Load plugin class files.
require_once 'includes/class-wp-plugin-template.php';
require_once 'includes/class-wp-plugin-template-settings.php';
require_once 'includes/class-wp-plugin-template-shortcodes.php';
// Load plugin libraries.
require_once 'includes/lib/class-wp-plugin-template-admin-api.php';
require_once 'includes/lib/class-wp-plugin-template-post-type.php';
require_once 'includes/lib/class-wp-plugin-template-taxonomy.php';
require_once 'includes/lib/class-wp-plugin-template-shortcode.php';
// Load plugin custom shortcodes.
require_once 'includes/shortcodes/class-wp-plugin-template-shortcode-powered-by.php';
/**
* Returns the main instance of WP_Plugin_Template to prevent the need to use globals.
*
* @since 0.1.0
* @return object WP_Plugin_Template
*/
function wp_plugin_template() {
$instance = WP_Plugin_Template::instance( __FILE__, '0.1.0' );
if ( null === $instance->settings ) {
$instance->settings = WP_Plugin_Template_Settings::instance( $instance );
}
if ( null === $instance->shortcodes_api ) {
$instance->shortcodes_api = WP_Plugin_Template_ShortCodes::instance( $instance );
}
$instance->add_shortcode( WP_Plugin_Template_Shortcode_Powered_By::instance( $instance ) );
return $instance;
}
wp_plugin_template();