mirror of
https://github.com/woocommerce/woocommerce-paypal-payments.git
synced 2025-09-01 07:02:48 +08:00
Work around possible wc-admin fatal error
This commit is contained in:
parent
095acaee4e
commit
ab27d10383
2 changed files with 6 additions and 2 deletions
|
@ -34,7 +34,11 @@ class DeactivateNote {
|
|||
return;
|
||||
}
|
||||
|
||||
self::possibly_add_note();
|
||||
try {
|
||||
self::possibly_add_note();
|
||||
} catch ( \Exception $e ) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -68,7 +68,7 @@ class CompatModule implements ModuleInterface {
|
|||
add_action(
|
||||
'woocommerce_init',
|
||||
function() {
|
||||
if ( is_callable( array( WC(), 'is_wc_admin_active' ) ) && WC()->is_wc_admin_active() ) {
|
||||
if ( is_callable( array( WC(), 'is_wc_admin_active' ) ) && WC()->is_wc_admin_active() && class_exists( 'Automattic\WooCommerce\Admin\Notes\Notes' ) ) {
|
||||
PPEC\DeactivateNote::init();
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue