-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathEES_Custom_Csv_Importer.shortcode.php
93 lines (80 loc) · 2.33 KB
/
EES_Custom_Csv_Importer.shortcode.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
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
<?php
if (! defined('EVENT_ESPRESSO_VERSION')) {
exit();
}
/*
* EES_Custom_Csv_Importer
*
* @package Event Espresso
* @subpackage eea-custom-csv-importer
* @author Brent Christensen
* @ version $VID:$
*
* ------------------------------------------------------------------------
*/
class EES_Custom_Csv_Importer extends EES_Shortcode
{
/**
* set_hooks - for hooking into EE Core, modules, etc
*
* @access public
* @return void
*/
public static function set_hooks()
{
}
/**
* set_hooks_admin - for hooking into EE Admin Core, modules, etc
*
* @access public
* @return void
*/
public static function set_hooks_admin()
{
}
/**
* set_definitions
*
* @access public
* @return void
*/
public static function set_definitions()
{
}
/**
* run - initial shortcode module setup called during "wp_loaded" hook
* this method is primarily used for loading resources that will be required by the shortcode when it is actually processed
*
* @access public
* @param WP $WP
* @return void
*/
public function run(WP $WP)
{
// this will trigger the EED_Custom_Csv_Importer module's run() method during the pre_get_posts hook point,
// this allows us to initialize things, enqueue assets, etc,
// as well, this saves an instantiation of the module in an array, using 'custom_csv_importer' as the key, so that we can retrieve it
EE_Registry::instance()->REQ->set('ee', 'custom_csv_importer');
EED_Custom_Csv_Importer::$shortcode_active = true;
}
/**
* process_shortcode
*
* [ESPRESSO_CUSTOM_CSV_IMPORTER]
*
* @param array|string $attributes
* @return string
*/
public function process_shortcode($attributes = []): string
{
// make sure $attributes is an array
$attributes = array_merge(
// defaults
array(),
(array) $attributes
);
return EE_Registry::instance()->modules['custom_csv_importer']->display_custom_csv_importer($attributes);
}
}
// End of file EES_Custom_Csv_Importer.shortcode.php
// Location: /wp-content/plugins/eea-custom-csv-importer/EES_Custom_Csv_Importer.shortcode.php