-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathplugin.php
More file actions
44 lines (39 loc) · 1.12 KB
/
plugin.php
File metadata and controls
44 lines (39 loc) · 1.12 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
<?php
/**
* Plugin Name: Publisher Name custom plugin
* Plugin URI: https://newspack.com
* Description: One plugin to rule them all.
* Version: 1.0.0
* Author: Publisher Name
* Author URI: Publisher Website
* Text Domain: publisher-name
*
* For more information on WordPress plugin headers, see the following page:
* https://developer.wordpress.org/plugins/plugin-basics/header-requirements/
*
* @package PublisherName
*/
// Ensure that everything is namespaced.
namespace PublisherName;
// Exit if accessed directly.
defined( 'ABSPATH' ) || exit;
// This will load composer's autoload.
// Keep in mind that you need to run `composer dump-autoload` after adding new classes.
if ( file_exists( __DIR__ . '/vendor/autoload.php' ) ) {
require_once __DIR__ . '/vendor/autoload.php';
} else {
// Add admin notice in case the plugin has not been built.
add_action(
'admin_notices',
function() {
?>
<div class="notice notice-error">
<p><?php esc_html_e( 'Publisher Name plugin was not properly built.', 'publisher-name' ); ?></p>
</div>
<?php
}
);
return;
}
// Initialize the plugin.
Module_Loader::init();