Skip to content

Instantly share code, notes, and snippets.

@david-binda
Created December 11, 2015 15:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save david-binda/4ed499e1f6183eaaf2bf to your computer and use it in GitHub Desktop.
Save david-binda/4ed499e1f6183eaaf2bf to your computer and use it in GitHub Desktop.
Patch for www/wp-content/plugins/log-deprecated-notices/log-deprecated-notices.php
--- log-deprecated-notices.php 2015-11-06 18:00:35.000000000 +0100
+++ log-deprecated-notices.php 2015-12-11 14:14:09.000000000 +0100
@@ -181,9 +181,17 @@
$hook = null;
$bt = 4;
// Check if we're a hook callback.
- if ( ! isset( $backtrace[4]['file'] ) && 'call_user_func_array' == $backtrace[5]['function'] ) {
- $hook = $backtrace[6]['args'][0];
- $bt = 6;
+ if ( ! isset( $backtrace[4]['file'] ) ) {
+ if ( 'call_user_func_array' == $backtrace[5]['function'] ) {
+ $hook = $backtrace[6]['args'][0];
+ $bt = 6;
+ } elseif( 'call_user_func' == $backtrace[5]['function'] ) {
+ $hook = $backtrace[6]['function'];
+ if ( isset( $backtrace[6]['class'] ) && ! empty( $backtrace[6]['class'] ) ) {
+ $hook = $backtrace[6]['class'] . '::' . $hook;
+ }
+ $bt = 6;
+ }
}
$in_file = $this->strip_abspath( $backtrace[ $bt ]['file'] );
$on_line = $backtrace[ $bt ]['line'];
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment