Check that the possibly_add_note function exists before calling it (https://github.com/woocommerce/woocommerce-admin/pull/4680)

Co-authored-by: Rebecca Scott <me@becdetat.com>
This commit is contained in:
Bec Scott 2020-06-25 06:38:43 +10:00 committed by GitHub
parent 1649706b22
commit 89342be595
1 changed files with 3 additions and 1 deletions

View File

@ -53,7 +53,9 @@ class Package {
self::$active_version = WC_ADMIN_VERSION_NUMBER;
$update_version = new WC_Admin_Notes_Deactivate_Plugin();
if ( version_compare( WC_ADMIN_VERSION_NUMBER, self::VERSION, '<' ) ) {
$update_version::possibly_add_note();
if ( method_exists( $update_version, 'possibly_add_note' ) ) {
$update_version::possibly_add_note();
}
} else {
$update_version::delete_note();
}