| 1 |
<?php defined( 'ABSPATH' ) or die; |
| 2 |
|
| 3 |
$basepath = dirname( __FILE__ ) . DIRECTORY_SEPARATOR; |
| 4 |
|
| 5 |
$debug = defined( 'WP_DEBUG' ) && WP_DEBUG; |
| 6 |
|
| 7 |
$options = get_option( 'pixtypes_settings' ); |
| 8 |
|
| 9 |
$display_settings = false; |
| 10 |
|
| 11 |
if ( isset( $options['display_settings'] ) ) { |
| 12 |
$display_settings = $options['display_settings']; |
| 13 |
} |
| 14 |
|
| 15 |
return array( |
| 16 |
'plugin-name' => 'pixtypes', |
| 17 |
|
| 18 |
'settings-key' => 'pixtypes_settings', |
| 19 |
|
| 20 |
'textdomain' => 'pixtypes', |
| 21 |
|
| 22 |
'template-paths' => array( |
| 23 |
$basepath . 'core/views/form-partials/', |
| 24 |
$basepath . 'views/form-partials/', |
| 25 |
), |
| 26 |
|
| 27 |
'fields' => array( |
| 28 |
'hiddens' |
| 29 |
=> include 'settings/hiddens' . PIXTYPES_EXT, |
| 30 |
'post_types' |
| 31 |
=> include 'settings/post_types' . PIXTYPES_EXT, |
| 32 |
'taxonomies' |
| 33 |
=> include 'settings/taxonomies' . PIXTYPES_EXT, |
| 34 |
), |
| 35 |
|
| 36 |
'processor' => array( |
| 37 |
// callback signature: (array $input, PixtypesProcessor $processor) |
| 38 |
|
| 39 |
'preupdate' => array( |
| 40 |
// callbacks to run before update process |
| 41 |
// cleanup and validation has been performed on data |
| 42 |
), |
| 43 |
'postupdate' => array( |
| 44 |
'save_settings' |
| 45 |
), |
| 46 |
), |
| 47 |
|
| 48 |
'cleanup' => array( |
| 49 |
'switch' => array( 'switch_not_available' ), |
| 50 |
), |
| 51 |
|
| 52 |
'checks' => array( |
| 53 |
'counter' => array( 'is_numeric', 'not_empty' ), |
| 54 |
), |
| 55 |
|
| 56 |
'errors' => array( |
| 57 |
'not_empty' => esc_html__( 'Invalid Value.', pixtypes::textdomain() ), |
| 58 |
), |
| 59 |
|
| 60 |
'callbacks' => array( |
| 61 |
'save_settings' => 'save_pixtypes_settings' |
| 62 |
), |
| 63 |
|
| 64 |
'display_settings' => $display_settings, |
| 65 |
|
| 66 |
// shows exception traces on error |
| 67 |
'debug' => $debug, |
| 68 |
|
| 69 |
); # config |
| 70 |
|