Created
March 25, 2020 23:36
-
-
Save MogulChris/5abfe283bd3a4ccc16e4a6d013ff0c30 to your computer and use it in GitHub Desktop.
WordPress - disable warnings about a specific function
This file contains hidden or 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 | |
//Since 5.3 WordPress spits out this notice: add_submenu_page was called incorrectly. The seventh parameter passed to add_submenu_page() should be an integer representing menu position. | |
//I've fixed my own plugins, but it's still coming from a WP Engine mu-plugin which I can't fix or disable, and I still want WP_DEBUG_DISPLAY enabled so I can see other errors and warnings. | |
//Solution: apply_filters( 'doing_it_wrong_trigger_error', true, $function, $message, $version ) | |
function mf_hide_annoying_notice($a, $function) { | |
if($function == 'add_submenu_page') return false; | |
} | |
add_filter('doing_it_wrong_trigger_error','mf_hide_annoying_notice',10,2); | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment