diff --git a/classes/class-kco-logger.php b/classes/class-kco-logger.php index 01b85ada..e44463dd 100644 --- a/classes/class-kco-logger.php +++ b/classes/class-kco-logger.php @@ -110,7 +110,7 @@ public static function get_stack() { if ( in_array( $data['function'], array( 'do_action', 'apply_filters' ), true ) ) { if ( isset( $data['object'] ) && $data['object'] instanceof WP_Hook ) { $priority = $data['object']->current_priority(); - $name = key( $data['object']->current() ); + $name = is_array( $data['object']->current() ) ? key( $data['object']->current() ) : ''; $extra_data = $name . ' : ' . $priority; } } @@ -137,5 +137,4 @@ public static function log_to_db( $data ) { $logs = wp_json_encode( $logs ); update_option( 'krokedil_debuglog_kco', $logs, false ); } - }