/** * @return bool */ public function save() { $search = esc_url_raw(filter_input(INPUT_POST, 'search')); $replace = esc_url_raw(filter_input(INPUT_POST, 'replace')); $new_db_prefix = esc_attr(filter_input(INPUT_POST, 'new_db_prefix')); //search field should not be empty if ('' === $replace) { $this->add_error(esc_html__('Replace Field should not be empty.', 'search-and-replace')); return FALSE; } $report = $this->dbe->db_backup($search, $replace, array(), TRUE, $new_db_prefix); $this->downloader->show_modal($report); return TRUE; }
/** * event handler for click on export sql button */ public function save() { $report = $this->dbe->db_backup(); $this->downloader->show_modal($report); return TRUE; }