/** * get_options * @since 1.0 */ public static function get_options() { if (self::$options == null) { $options = get_option('scnb_settings'); if (empty($options)) { $options = SCNB::instance()->default_options; } self::$options = $options; /* set new options on updates */ foreach (SCNB::instance()->default_options as $key => $value) { if (!isset(self::$options[$key])) { self::$options[$key] = SCNB::instance()->default_options[$key]; } } } return self::$options; }
/** * add_cookiebar */ public function add_cookiebar() { $options = SCNB::get_options(); do_action('scbn_custom_style', $options); require_once SCNB_PLUGIN_DIR . 'includes/front-cookiebar.php'; }
/** * save_default_options * runed on activation of the plugin * helps with comatibility with polylang and wpml * @since 1.4 */ public static function save_default_options() { $options = get_option('scnb_settings'); if (empty($options)) { $options = SCNB::get_options(); update_option('scnb_settings', $options); } return; }