diff --git a/plugins/woocommerce-admin/changelogs/fix-7938-navigation-feedback-follow-up-note-should-self-delete-when-not-relevant b/plugins/woocommerce-admin/changelogs/fix-7938-navigation-feedback-follow-up-note-should-self-delete-when-not-relevant new file mode 100644 index 00000000000..4afc369d7e8 --- /dev/null +++ b/plugins/woocommerce-admin/changelogs/fix-7938-navigation-feedback-follow-up-note-should-self-delete-when-not-relevant @@ -0,0 +1,4 @@ +Significance: minor +Type: Fix + +Self-delete NavigationFeedbackFollowUp note when navigation feature is not present. #7939 diff --git a/plugins/woocommerce-admin/src/Events.php b/plugins/woocommerce-admin/src/Events.php index 08a0d0b4f2e..442c4114076 100644 --- a/plugins/woocommerce-admin/src/Events.php +++ b/plugins/woocommerce-admin/src/Events.php @@ -163,6 +163,7 @@ class Events { protected function possibly_delete_notes() { NavigationNudge::delete_if_not_applicable(); NavigationFeedback::delete_if_not_applicable(); + NavigationFeedbackFollowUp::delete_if_not_applicable(); } /** diff --git a/plugins/woocommerce-admin/src/Notes/NavigationFeedbackFollowUp.php b/plugins/woocommerce-admin/src/Notes/NavigationFeedbackFollowUp.php index 8d2cde05140..e0be7fb7eb3 100644 --- a/plugins/woocommerce-admin/src/Notes/NavigationFeedbackFollowUp.php +++ b/plugins/woocommerce-admin/src/Notes/NavigationFeedbackFollowUp.php @@ -24,6 +24,13 @@ class NavigationFeedbackFollowUp { */ const NOTE_NAME = 'wc-admin-navigation-feedback-follow-up'; + /** + * Should this note exist? (The navigation feature should exist.) + */ + public static function is_applicable() { + return Features::exists( 'navigation' ); + } + /** * Get the note. *