-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path{{PLUGIN_SLUG}}.php
More file actions
49 lines (45 loc) · 1.34 KB
/
{{PLUGIN_SLUG}}.php
File metadata and controls
49 lines (45 loc) · 1.34 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
<?php
/**
* Plugin Name: {{PLUGIN_NAME}}
* Plugin URI: {{PLUGIN_URI}}
* Description: {{PLUGIN_DESCRIPTION}}
* Version: 0.1.0
* Requires at least: 6.4
* Requires PHP: 8.0
* Author: {{AUTHOR_NAME}}
* Author URI: {{AUTHOR_URI}}
* License: GPL-2.0-or-later
* License URI: https://www.gnu.org/licenses/gpl-2.0.html
* Text Domain: {{TEXT_DOMAIN}}
* Domain Path: /languages
*
* @package {{NAMESPACE}}
*/
// Prevent direct access.
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
// Plugin constants.
define( '{{NAMESPACE}}_VERSION', '0.1.0' );
define( '{{NAMESPACE}}_PLUGIN_FILE', __FILE__ );
define( '{{NAMESPACE}}_PLUGIN_DIR', plugin_dir_path( __FILE__ ) );
define( '{{NAMESPACE}}_PLUGIN_URL', plugin_dir_url( __FILE__ ) );
/**
* Load the plugin text domain for translation.
*/
function {{PLUGIN_SLUG}}_load_textdomain() {
load_plugin_textdomain(
'{{TEXT_DOMAIN}}',
false,
dirname( plugin_basename( __FILE__ ) ) . '/languages'
);
}
add_action( 'init', '{{PLUGIN_SLUG}}_load_textdomain' );
/**
* Load optional plugin includes.
* Add your include files in inc/ and require them here when ready.
*/
function {{PLUGIN_SLUG}}_init() {
// Example: require_once {{NAMESPACE}}_PLUGIN_DIR . 'inc/class-{{PLUGIN_SLUG}}-example.php';
}
add_action( 'plugins_loaded', '{{PLUGIN_SLUG}}_init' );