-
-
Save justinshreve/5bc9aad5a7ab36b0f74afaa52e11c340 to your computer and use it in GitHub Desktop.
Displays a backtrace for deprecation notices.
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 | |
/** | |
* Plugin Name: Deprecation Backtrace | |
* Description: Shows the line number and file where a deprecation notice occurs. | |
* Version: 1.0.0 | |
* Author: WooCommerce | |
*/ | |
// https://westi.wordpress.com/2012/01/28/tracing-things-back-to-where-they-came-from/ | |
// https://westi.wordpress.com/2012/01/28/tracing-things-back-to-where-they-came-from/#comment-14182 | |
function deprecation_notice_backtrace() { | |
error_log( wp_debug_backtrace_summary() ); | |
} | |
add_action( 'doing_it_wrong_run', 'deprecation_notice_backtrace' ); | |
add_action( 'deprecated_argument_run', 'deprecation_notice_backtrace' ); | |
add_action( 'deprecated_function_run', 'deprecation_notice_backtrace' ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment