/** * Install plugin tables. * * @return bool */ public function install_plugin() { $installer = new Mlp_Db_Installer(new Mlp_Db_Languages_Schema($this->wpdb)); $installer->install(); $installer->install(new Mlp_Content_Relations_Schema($this->wpdb)); $installer->install(new Mlp_Site_Relations_Schema($this->wpdb)); return update_site_option('mlp_version', $this->plugin_data->get('version')); }
/** * @return void */ public function reset_table() { check_admin_referer($this->page_data->get_nonce_action(), $this->page_data->get_nonce_name()); $table_schema = new Mlp_Db_Languages_Schema($this->wpdb); $installer = new Mlp_Db_Installer($table_schema); $installer->uninstall(); $installer->install(); /** * Action after resetting the database-tables of MLP * *@param Mlp_Db_Languages_Schema $table_schema */ do_action('mlp_reset_table_done', $table_schema); $url = add_query_arg('msg', 'resettable', $_REQUEST['_wp_http_referer']); wp_safe_redirect($url); exit; }