Skip to content

Commit

Permalink
Add a filter for the screens which remove admin notices
Browse files Browse the repository at this point in the history
  • Loading branch information
pattonwebz committed Jun 10, 2024
1 parent b6675dd commit 3b5fccb
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions admin/class-admin-notices.php
Original file line number Diff line number Diff line change
Expand Up @@ -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' );
Expand Down

0 comments on commit 3b5fccb

Please sign in to comment.