Last active
April 23, 2025 06:16
-
-
Save Zodiac1978/0371d1371010d267ad15a404b49ba357 to your computer and use it in GitHub Desktop.
Log the function name when doing_it_wrong is triggered (best used very early, for example in a mu-plugin)
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
/** | |
* Log the function name when doing_it_wrong is triggered | |
* | |
* @param string $function_name The function name that triggered the error | |
*/ | |
function log_function_name( $function_name ) { | |
// Taken from https://x.com/jkohlbach/status/1912769898171998653 | |
if ('_load textdomain_just_in_time' === $function_name ) { | |
error_log( wp_debug_backtrace_summary() ); | |
} | |
} | |
add_action ('doing_it_wrong_run', 'log_function_name', 10, 1 ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment