Last active
November 1, 2017 23:28
-
-
Save ann71727/94246e8dcdc8c93bc2c8e77fd6817962 to your computer and use it in GitHub Desktop.
WordPress Remove notice and warning
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 | |
/** | |
* WordPress Remove notice and warning | |
* https://v123.tw | |
*/ | |
add_action('admin_print_scripts', 'ure_remove_admin_notices'); | |
function ure_remove_admin_notices() { | |
global $wp_filter; | |
if (is_user_admin()) { | |
if (isset($wp_filter['user_admin_notices'])) { | |
unset($wp_filter['user_admin_notices']); | |
} | |
} elseif (isset($wp_filter['admin_notices'])) { | |
unset($wp_filter['admin_notices']); | |
} | |
if (isset($wp_filter['all_admin_notices'])) { | |
unset($wp_filter['all_admin_notices']); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment