<?php return array('cleanup' => array('switch' => array('switch_not_available')), 'checks' => array('counter' => array('is_numeric', 'not_empty')), 'processor' => array('preupdate' => array(), 'postupdate' => array()), 'errors' => array('is_numeric' => __('Numberic value required.', custom_body_class::textdomain()), 'not_empty' => __('Field is required.', custom_body_class::textdomain())), 'callbacks' => array('switch_not_available' => 'custom_body_class_cleanup_switch_not_available', 'is_numeric' => 'custom_body_class_validate_is_numeric', 'not_empty' => 'custom_body_class_validate_not_empty')); # config
<?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('custom_body_class_settings'); $display_settings = false; if (isset($options['display_settings'])) { $display_settings = $options['display_settings']; } return array('plugin-name' => 'custom_body_class', 'settings-key' => 'custom_body_class_settings', 'textdomain' => 'custom_body_class_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), 'processor' => array('preupdate' => array('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.', custom_body_class::textdomain())), 'callbacks' => array('save_settings' => 'save_custom_body_class_settings'), 'debug' => $debug); # config
/** * Sets a custom text domain; if null is passed the text domain will revert * to the default text domain. */ static function settextdomain($textdomain) { if (!empty($textdomain)) { self::$textdomain = $textdomain; } else { // null or otherwise empty value // revert to default self::$textdomain = 'custom_body_class_txtd'; } }