Run dbdelta on init, at least as long as this is a separate plugin
This commit is contained in:
parent
0f45a08f20
commit
3c323d6c75
|
@ -92,6 +92,16 @@ function deactivate_wc_admin_plugin() {
|
|||
}
|
||||
register_deactivation_hook( WC_ADMIN_PLUGIN_FILE, 'deactivate_wc_admin_plugin' );
|
||||
|
||||
/**
|
||||
* Update the database tables if needed. This hooked function does NOT need to
|
||||
* be ported to WooCommerce's code base - WC_Install will do this on plugin
|
||||
* update automatically.
|
||||
*/
|
||||
function wc_admin_init() {
|
||||
WC_Admin_Api_Init::create_db_tables();
|
||||
}
|
||||
add_action( 'init', 'wc_admin_init' );
|
||||
|
||||
/**
|
||||
* Set up the plugin, only if we can detect both Gutenberg and WooCommerce
|
||||
*/
|
||||
|
|
Loading…
Reference in New Issue