Skip to content

Commit

Permalink
Fix TypeError in logger expecting array receiving bool
Browse files Browse the repository at this point in the history
  • Loading branch information
mntzrr committed Jun 12, 2024
1 parent 4c30d4a commit 1f20c68
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions classes/class-kco-logger.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
}
Expand All @@ -137,5 +137,4 @@ public static function log_to_db( $data ) {
$logs = wp_json_encode( $logs );
update_option( 'krokedil_debuglog_kco', $logs, false );
}

}

0 comments on commit 1f20c68

Please sign in to comment.