-
Notifications
You must be signed in to change notification settings - Fork 0
/
plugin-config.php
71 lines (63 loc) · 1.51 KB
/
plugin-config.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
<?php defined( 'ABSPATH' ) or die;
$basepath = dirname( __FILE__ ) . DIRECTORY_SEPARATOR;
$debug = false;
if ( isset( $_GET['debug'] ) && $_GET['debug'] == 'true' ) {
$debug = true;
}
$debug = true;
$options = get_option( 'pixfields_settings' );
$display_settings = false;
if ( isset( $options['display_settings'] ) ) {
$display_settings = $options['display_settings'];
}
return array
(
'plugin-name' => 'pixfields',
'settings-key' => 'pixfields_settings',
'textdomain' => 'pixfields_txtd',
'template-paths' => array
(
$basepath . 'core/views/form-partials/',
$basepath . 'views/form-partials/',
),
'fields' => array
(
'hiddens'
=> include 'settings/hiddens' . EXT,
'general'
=> include 'settings/general' . EXT,
'fields_manager'
=> include 'settings/fields_manager' . EXT,
),
'processor' => array
(
// callback signature: (array $input, PixtypesProcessor $processor)
'preupdate' => array
(
// callbacks to run before update process
// cleanup and validation has been performed on data
'save_settings'
),
'postupdate' => array
(
),
),
'cleanup' => array
(
'switch' => array( 'switch_not_available' ),
),
'checks' => array
(
'counter' => array( 'is_numeric', 'not_empty' ),
),
'errors' => array
(
'not_empty' => __( 'Invalid Value.', pixfields::textdomain() ),
),
'callbacks' => array
(
'save_settings' => 'save_pixfields_settings'
),
// shows exception traces on error
'debug' => $debug,
); # config