public function __construct() { add_action('admin_init', array($this, 'edbfnd_admin_init')); add_action('admin_menu', array($this, 'add_edbfnd_page')); $edbfnd = new edbfnd(); $this->tables = $edbfnd->get_tables(); }
function edbfnd_run() { if (isset($_POST['new_site'])) { if (check_admin_referer('export_db_for_new_domain')) { $output = new edbfnd(); $filename = DB_NAME . '.sql'; header("Content-type: application/octet-stream"); header('Content-Disposition: attachment; filename=' . $filename); echo $output->print_all_sql(); exit; } } if (isset($_POST['search_in_db'])) { if (check_ajax_referer('edbfnd_search_in_db', 'search_in_db_nonce')) { $output = new edbfnd(); echo $output->search_in_db($_POST['search_in_db']); die; } } if (isset($_POST['search_in_db_table'])) { if (check_ajax_referer('edbfnd_search_in_db_table', 'search_in_db_table_nonce')) { $output = new edbfnd(); echo $output->search_in_db_table($_POST['search_in_db_table'], $_POST['search_in_db_table_for']); die; } } }