Last active
March 18, 2025 20:20
-
-
Save afragen/986ba6046ebea963074283a77cae07fc to your computer and use it in GitHub Desktop.
Place in mu-plugins folder
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 | |
/** | |
* Quiet specific trigger warnings. | |
* | |
* @package Quiet_Trigger_Errors | |
* | |
* Plugin Name: Quiet Trigger Errors | |
* Plugin URI: https://gist.github.com/afragen/986ba6046ebea963074283a77cae07fc | |
* Description: Quiet the trigger warnings to the error log. | |
* Version: 0.4.2 | |
* Author: Andy Fragen | |
* License: MIT | |
* Requires at least: 6.7 | |
* Requires PHP: 8.0 | |
* Gist Plugin URI: https://gist.github.com/afragen/986ba6046ebea963074283a77cae07fc | |
*/ | |
add_filter( | |
'doing_it_wrong_trigger_error', | |
function ($trigger, $function_name) { | |
$func_arr = ['_load_textdomain_just_in_time']; | |
if (in_array($function_name, $func_arr, true)) { | |
$trigger = false; | |
} | |
return $trigger; | |
}, | |
10, | |
2 | |
); |
QM recently updated to fix this issue.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Your
remove_action
call does nothing since QueryMonitor is not loaded at that point. Also, the action callback should be an instance method, not a class method.Here's what worked for me: