-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathimaginary-webhooks.php
48 lines (41 loc) · 1.23 KB
/
imaginary-webhooks.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
<?php
/**
* Plugin Name: Imaginary Webhooks
* Plugin URI:
* Description:
* Version: 0.0.1
* Requires at least: 6.0
* Requires PHP: 7.1.0
* Author:
* Author URI:
* License: GPL v2 or later
* License URI: https://www.gnu.org/licenses/gpl-2.0.html
* Text Domain: imaginary-webhooks
* Domain Path: /languages
*/
use ImaginaryMachines\Webhooks\Plugin;
use ImaginaryMachines\Webhooks\Url;
use ImaginaryMachines\Webhooks\WebhookPostType;
if ( file_exists(__DIR__ . '/vendor/autoload.php' ) ) {
include __DIR__ . '/vendor/autoload.php';
/**
* @return Plugin
*/
function imwm_webhook(){
static $imwm_webhook;
if ( ! $imwm_webhook ) {
$imwm_webhook = new Plugin();
WebhookPostType::addColumns();
do_action('imwm_webhook',$imwm_webhook);
}
return $imwm_webhook;
}
include_once dirname( __FILE__ ) . '/admin/webooks-settings/init.php';
imwm_webhook();
}else{
add_action( 'admin_notices', function () {
echo '<div class="notice notice-error is-dismissible">
<p>Imaginary Webhooks requires the <a href="https://getcomposer.org/">Composer</a> package manager to be installed.</p>
</div>';
} );
}