-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathstackverify-connector.php
More file actions
58 lines (45 loc) · 1.36 KB
/
Copy pathstackverify-connector.php
File metadata and controls
58 lines (45 loc) · 1.36 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
50
51
52
53
54
55
56
57
58
<?php
/*
Plugin Name: StackVerify Connector
Plugin URI: https://stackverify.site/forms
Description: Connects WordPress forms and WP Webhooks with StackVerify automation engine.
Version: 1.0.0
Author: Morgan Miller
Author URI: https://stackverify.site
License: GPL-3.0
Text Domain: stackverify-connector
*/
if ( ! defined( 'ABSPATH' ) ) exit;
add_action( 'plugins_loaded', 'stackverify_register_wpwebhooks_integration', 20 );
add_action( 'admin_notices', 'stackverify_missing_dependency_notice' );
function stackverify_register_wpwebhooks_integration(){
if (
! function_exists( 'WPWHPRO' )
||
! isset( WPWHPRO()->integrations )
){
return;
}
$integration_file =
plugin_dir_path( __FILE__ )
. 'includes/integrations/stackverify/stackverify.php';
if( file_exists( $integration_file ) ){
WPWHPRO()->integrations->register_integration(
array(
'slug' => 'stackverify',
'path' => $integration_file
)
);
}
}
function stackverify_missing_dependency_notice(){
if ( function_exists( 'WPWHPRO' ) ){
return;
}
echo '<div class="notice notice-error"><p>';
echo esc_html__(
'StackVerify Connector requires WP Webhooks Pro to be installed and active.',
'stackverify-connector'
);
echo '</p></div>';
}