From 3b5fccb8e550424cfb5328a46f44b913bd5c3106 Mon Sep 17 00:00:00 2001 From: pattonwebz Date: Mon, 10 Jun 2024 18:06:44 +0100 Subject: [PATCH] Add a filter for the screens which remove admin notices --- admin/class-admin-notices.php | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/admin/class-admin-notices.php b/admin/class-admin-notices.php index 0e876912..6b5cb3be 100644 --- a/admin/class-admin-notices.php +++ b/admin/class-admin-notices.php @@ -66,6 +66,15 @@ public function edac_remove_admin_notices() { 'accessibility-checker_page_accessibility_checker_settings', ]; + /** + * Filter the screens where admin notices should be removed. + * + * @since 1.14.0 + * + * @param array $screens The screens where admin notices should be removed. + */ + $screens = apply_filters( 'edac_filter_remove_admin_notices_screens', $screens ); + if ( in_array( $current_screen->id, $screens, true ) ) { remove_all_actions( 'admin_notices' ); remove_all_actions( 'all_admin_notices' );