config.php
1.53 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
59
60
61
62
63
64
65
66
67
<?php
namespace q\eud\core;
// import classes ##
use q\eud;
use q\eud\plugin as plugin;
use q\eud\core\helper as h;
class config {
private $plugin;
function __construct(){
$this->plugin = plugin::get_instance();
}
/**
* Load up saved exports for this user
* Set to public as hooked into action
*
* @since 0.9.6
* @return Array of saved exports
*/
public static function load(){
// load api admin fields ##
self::get_admin_fields();
}
/**
* Load up saved exports for this user
* Set to public as hooked into action
*
* @since 0.9.6
* @return Array of saved exports
*/
public function get_admin_fields(){
// build array ##
$array = [
'program' => [
'title' => \_e( 'Programs', 'export-user-data' ),
'label' => 'program',
'description' => \__( 'Select the program that you wish to export.', 'export-user-data' ),
'label_select' => \__( 'All Programs', 'export-user-data' ),
'options' => \get_posts([ 'post_type'=> 'program', 'posts_per_page' => -1 ]),
'options_ID' => 'ID',
'options_title' => 'post_title'
]
];
// filter and return ##
apply_filters( 'q/eud/api/admin_fields', $array );
// add to static property ##
$this->plugin->set( '_api_admin_fields', $array );
// kick back true ##
return true;
}
}