-
Notifications
You must be signed in to change notification settings - Fork 0
/
wp-plugin.php
54 lines (50 loc) · 1.69 KB
/
wp-plugin.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
<?php
/**
* %%pluginName%%
*
* @package %%pluginPackage%%
* @author %%pluginAuthor%%
* @copyright Copyright %%currentYear%% by %%pluginAuthor%% - All rights reserved.
* @license GPL2.0-or-later
*
* @wordpress-plugin
* Plugin Name: %%pluginName%%
* Plugin URI: %%pluginUri%%
* Description: %%pluginDescription%%
* Version: 1.0
* Requires PHP: %%pluginPhpVersion%%
* Requires at least: %%pluginWpVersion%%
* Author: %%pluginAuthor%%
* Author URI: %%pluginAuthorUri%%
* Text Domain: %%pluginTextDomain%%
* Domain Path: /languages
* Update URI: %%pluginUpdateUri%%
* License: GPL V2 or later
* License URI: https://www.gnu.org/licenses/gpl-2.0.html
*
* Generated using https://github.com/wp-forge/wp-plugin
*/
// Exit if accessed directly
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
define( '%%pluginConstantPrefix%%FILE', __FILE__ );
define( '%%pluginConstantPrefix%%DIR', plugin_dir_path( __FILE__ ) );
define( '%%pluginConstantPrefix%%URL', plugin_dir_url( __FILE__ ) );
if ( is_readable( __DIR__ . '/vendor/autoload.php' ) ) {
require __DIR__ . '/vendor/autoload.php';
// TODO: Uncomment this if you have dependencies, delete otherwise
//} else {
// if ( 'local' === wp_get_environment_type() ) {
// wp_die( esc_html( __( 'Please install the %%pluginName%% dependencies.', '%%pluginTextDomain%%' ) ) );
// }
//
// return;
}
// Automatically load all PHP files in the 'hooks' directory
$iterator = new RecursiveDirectoryIterator( __DIR__ . '/hooks' );
foreach ( new RecursiveIteratorIterator( $iterator ) as $file ) {
if ( $file->getExtension() === 'php' ) {
require $file;
}
};