-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwpcivi-shared.php
64 lines (45 loc) · 1.61 KB
/
wpcivi-shared.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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
<?php
/*
Plugin Name: WPCivi Shared
Plugin URI: https://github.com/civicoop/wpcivi-shared
Description: Shared, reusable code for WordPress + CiviCRM integration.
Version: 1.3.0
Author: CiviCooP / Kevin Levie
Author URI: https://levity.nl
License: AGPL 3 or later
License URI: http://www.gnu.org/licenses/agpl-3.0.txt
Text Domain: wpcivi
*/
/**
* WPCivi Shared: shared code for WordPress + CiviCRM integration.
* Load autoloader and register namespace, so other plugins can use our classes.
* @package WPCivi\Shared
*/
require_once __DIR__ . '/src/Autoloader.php';
/* --- LOAD AND REGISTER AUTOLOADER --- */
$wpciviloader = \WPCivi\Shared\Autoloader::getInstance();
$wpciviloader->register();
$wpciviloader->addNamespace('WPCivi\\Shared\\', __DIR__ . '/src/');
/* --- BACKEND GRAVITY FORM HANDLER --- */
add_action('admin_init', function() {
new \WPCivi\Shared\Gravity\BackendFormHandler;
new \WPCivi\Shared\Gravity\BackendEntityLink;
}, 51);
/* --- CUSTOM GRAVITY FIELD TYPES --- */
add_action('gform_loaded', function () {
$ogSelect = new \WPCivi\Shared\Gravity\Field\CiviOGSelect;
\GF_Fields::register($ogSelect);
$ogSelect->registerBackendHooks();
$countrySelect = new \WPCivi\Shared\Gravity\Field\CiviCountrySelect;
\GF_Fields::register($countrySelect);
$countrySelect->registerBackendHooks();
}, 11);
/* --- CUSTOM ACF FIELD TYPE --- */
add_action('acf/include_field_types', function() {
new \WPCivi\Shared\Widget\CiviWidgetACFField;
}, 51);
/* --- WELLICHT: LATER: WIDGETS --- */
/* add_action('widgets_init', function () {
register_widget(new ContactWidget);
});
}, 51); */