plugin_name = AGE_GATE_NAME;; $this->version = AGE_GATE_VERSION; $this->config = $this->_get_config(); $this->settings = $this->_get_settings(); $this->validation = new Age_Gate_Validation; } private function _get_config() { return (!is_admin() ? (object) array() : include AGE_GATE_PATH . 'admin/config/config.php'); } private function _get_settings($type = null) { $settings = apply_filters('ag_settings', array()); return array_merge($settings, array( 'restrictions' => get_option('wp_age_gate_restrictions', array()), 'messages' => get_option('wp_age_gate_messages', array()), 'validation' => get_option('wp_age_gate_validation_messages', array()), 'appearance' => get_option('wp_age_gate_appearance', array()), 'access' => get_option('wp_age_gate_access', array()), 'advanced' => get_option('wp_age_gate_advanced', array()), )); } protected function _set_admin_notice($notice = array()) { if(!$notices = get_transient('age_gate_admin_notice')){ $notices = array(); } $notices[] = $notice; set_transient('age_gate_admin_notice', $notices); } protected function is_dev() { $data = get_plugin_data( AGE_GATE_PATH . 'age-gate.php' ); $sub = explode('-', ($data['Version'])); if(isset($sub[1]) && !empty($sub[1])){ return $sub[1]; } return false; } /** * Strip slashes "usefully" added by WP * @param [type] $value [description] * @return [type] [description] */ protected function stripslashes_deep($value) { $value = is_array($value) ? array_map('stripslashes_deep', $value) : stripslashes($value); return $value; } }