-
Notifications
You must be signed in to change notification settings - Fork 3
/
plugin-config.php
72 lines (53 loc) · 1.47 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
72
<?php defined( 'ABSPATH' ) or die;
$basepath = dirname( __FILE__ ) . DIRECTORY_SEPARATOR;
$debug = false;
if ( isset( $_GET['debug'] ) && $_GET['debug'] == 'true' ) {
$debug = true;
}
$options = get_option( 'pixtypes_settings' );
$display_settings = false;
if ( isset( $options['display_settings'] ) ) {
$display_settings = $options['display_settings'];
}
return array(
'plugin-name' => 'pixtypes',
'settings-key' => 'pixtypes_settings',
'textdomain' => 'pixtypes',
'template-paths' => array(
$basepath . 'core/views/form-partials/',
$basepath . 'views/form-partials/',
),
'fields' => array(
'hiddens'
=> include 'settings/hiddens' . EXT,
'post_types'
=> include 'settings/post_types' . EXT,
'taxonomies'
=> include 'settings/taxonomies' . 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
),
'postupdate' => array(
'save_settings'
),
),
'cleanup' => array(
'switch' => array( 'switch_not_available' ),
),
'checks' => array(
'counter' => array( 'is_numeric', 'not_empty' ),
),
'errors' => array(
'not_empty' => esc_html__( 'Invalid Value.', pixtypes::textdomain() ),
),
'callbacks' => array(
'save_settings' => 'save_pixtypes_settings'
),
'display_settings' => $display_settings,
// shows exception traces on error
'debug' => $debug,
); # config