Call the installer in `register_activation_hook` (https://github.com/woocommerce/woocommerce-admin/pull/2220)

* Call installer in register_activation_hook

* Just create the tables
This commit is contained in:
Mike Jolley 2019-05-14 19:11:08 +01:00 committed by Timmy Crawford
parent a2dafef1d6
commit e91bf985f4
1 changed files with 4 additions and 0 deletions

View File

@ -169,6 +169,10 @@ function wc_admin_activate_wc_admin_plugin() {
if ( ! wp_next_scheduled( 'wc_admin_daily' ) ) {
wp_schedule_event( time(), 'daily', 'wc_admin_daily' );
}
// Run the installer on activation.
require_once WC_ADMIN_ABSPATH . 'includes/class-wc-admin-install.php';
WC_Admin_Install::create_tables();
}
register_activation_hook( WC_ADMIN_PLUGIN_FILE, 'wc_admin_activate_wc_admin_plugin' );