Merge pull request #14308 from woocommerce/add/14304

Add backtrace to deprecated message
This commit is contained in:
Claudio Sanches 2017-04-13 12:49:01 -03:00 committed by GitHub
commit 75ecc91d96
1 changed files with 2 additions and 0 deletions

View File

@ -59,6 +59,8 @@ function wc_deprecated_function( $function, $version, $replacement = null ) {
* @param string $replacement
*/
function wc_doing_it_wrong( $function, $message, $version ) {
$message .= ' Backtrace: ' . wp_debug_backtrace_summary();
if ( is_ajax() ) {
do_action( 'doing_it_wrong_run', $function, $message, $version );
error_log( "{$function} was called incorrectly. {$message}. This message was added in version {$version}." );