-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path%plugin_name%.php
More file actions
48 lines (43 loc) · 1.62 KB
/
Copy path%plugin_name%.php
File metadata and controls
48 lines (43 loc) · 1.62 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
<?php
/**
* Plugin Name: %plugin_name%
* Plugin URI: %plugin_uri%
* Description: %plugin_description%
* Version: %plugin_version%
* Author: %plugin_author%
* Author URI: %plugin_author_uri%
* Text Domain: %plugin_name%
* Domain Path: /languages
* Requires at least: 6.0
* Tested up to: 6.9
* Requires PHP: 8.2
* Network: false
* License: MIT
* License URI: https://opensource.org/licenses/MIT
*/
declare(strict_types=1);
use Pollora\Modules\Domain\Enums\ModuleType;
// Prevent direct access
if (! defined('ABSPATH')) {
exit;
}
// Plugin constants
define('%PLUGIN_NAME%_VERSION', '%plugin_version%');
define('%PLUGIN_NAME%_PLUGIN_FILE', __FILE__);
define('%PLUGIN_NAME%_PLUGIN_DIR', plugin_dir_path(__FILE__));
define('%PLUGIN_NAME%_PLUGIN_URL', plugin_dir_url(__FILE__));
/*
* Register with whichever Pollora version is running.
*
* make:plugin downloads this plugin's latest tag whatever framework the site
* has installed, so this file is the one place that has to work on both:
* pollora_register() arrived in 13.32, while sites still on 13.4 only have the
* registrar service. Calling the helper unconditionally takes those sites down
* with a fatal before anything can report why — so each path is guarded, and
* an unknown combination leaves the plugin unregistered rather than fatal.
*/
if (function_exists('pollora_register')) {
pollora_register(ModuleType::Plugin, '%plugin_slug%', __DIR__);
} elseif (class_exists('Pollora\\Plugin\\Application\\Services\\PluginRegistrar') && function_exists('app')) {
app('Pollora\\Plugin\\Application\\Services\\PluginRegistrar')->register('%plugin_slug%', __DIR__);
}