/** * update options page * @param $options */ public static function update_data($options) { if (is_array($options)) { //get_option(self::SETTINGS_OPTION_NAME); hw_add_wp_option(self::SETTINGS_OPTION_NAME, $options, true); //allow to merge options } }
/** * Create options based on import information */ public function processed_options() { $this->options = apply_filters('hw_import_options', $this->options); #__print($this->widgets);return; $context_data = $this->parser->_get_option('data', array()); //get update variables from context if (is_array($this->options) && count($this->options)) { foreach ($this->options as &$option) { //parse import result value if (!empty($option['import_results'])) { foreach ($option['import_results'] as &$value) { if ($value instanceof HWIE_Module_Import_Results) { $value->init($this->parser->importer, $context_data); $value = $value->parse_data($context_data)->value; } } } $option = apply_filters('hw_import_option_data_raw', $option); #__print($option['value']); hw_add_wp_option($option['name'], $option['value'], $option['method'] == 'override' ? false : true); //update_option($option['name'], $option['value']); $this->logger->add_log(sprintf('<div>Đã thêm option <strong>%s</strong></div>', $option['name'])); } } }