Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Displays a backtrace for deprecation notices.
* Plugin Name: Deprecation Backtrace
* Description: Shows the line number and file where a deprecation notice occurs.
* Version: 1.0.0
* Author: WooCommerce
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