Merge pull request woocommerce/woocommerce-admin#773 from woocommerce/fix/771-fatal-on-activation

Do not attempt to run table setup without dependency check first
This commit is contained in:
Allen Snook 2018-11-04 15:36:21 -08:00 committed by GitHub
commit 986c209658
1 changed files with 4 additions and 0 deletions

View File

@ -98,6 +98,10 @@ register_deactivation_hook( WC_ADMIN_PLUGIN_FILE, 'deactivate_wc_admin_plugin' )
* update automatically.
*/
function wc_admin_init() {
if ( ! dependencies_satisfied() ) {
return;
}
// Only create/update tables on init if WP_DEBUG is true.
if ( defined( 'WP_DEBUG' ) && WP_DEBUG ) {
WC_Admin_Api_Init::create_db_tables();