Created
March 28, 2025 19:33
-
-
Save renventura/e1eabe9bf6cec3d6d1429cded2b024b5 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<php | |
// Credit: https://www.reddit.com/r/Wordpress/s/rMRUiRHqgC | |
function hide_all_admin_notices() { | |
global $wp_filter; | |
if (isset($wp_filter['admin_notices'])) { | |
// Remove all actions hooked to the 'admin_notices' hook. | |
unset($wp_filter['admin_notices']); | |
} | |
} | |
add_action('admin_init', 'hide_all_admin_notices'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment