From 4b7e73aca4ead822342720d57ce09134af3b9d77 Mon Sep 17 00:00:00 2001 From: Bowo Date: Tue, 23 May 2023 00:04:14 +0700 Subject: [PATCH] Add handler for null type / value --- admin/class-variable-inspector-admin.php | 33 +++++++++++++----------- 1 file changed, 18 insertions(+), 15 deletions(-) diff --git a/admin/class-variable-inspector-admin.php b/admin/class-variable-inspector-admin.php index 129e2a6..8d69156 100644 --- a/admin/class-variable-inspector-admin.php +++ b/admin/class-variable-inspector-admin.php @@ -239,12 +239,7 @@ public function vi_generate_sample_results() // $backtrace = debug_backtrace(); // do_action( 'inspect', [ 'backtrace', $backtrace, __FILE__, __LINE__ ] ); global $current_user, $wp_roles, $wp_post_types ; - do_action( 'inspect', [ - 'wp_post_types', - $wp_post_types, - __FILE__, - __LINE__ - ] ); + // do_action( 'inspect', [ 'wp_post_types', $wp_post_types, __FILE__, __LINE__ ] ); // do_action( 'inspect', [ 'wp_roles', $wp_roles, __FILE__, __LINE__ ] ); do_action( 'inspect', [ 'current_user', @@ -386,6 +381,10 @@ public function vi_inspection_results() case 'object': $variable_content = (object) maybe_unserialize( $variable['content'] ); break; + case 'NULL': + $variable_type = 'null'; + $variable_content = NULL; + break; } $variable_category = ( $variable['category'] ? $variable['category'] : 'gray' ); $variable_notes = $variable['extra']; @@ -419,7 +418,7 @@ public function vi_inspection_results() $output .= '
'; $output .= '
' . esc_html( $variable_type ) . '' . esc_html( $variable_name ) . '' . esc_html( $variable_notes ) . '
'; $output .= ' -
+
var_export' . $separator . ' var_dump' . $separator . ' @@ -497,16 +496,19 @@ public function vi_create_main_page() + ✚ + + + - - ✚ - @@ -600,7 +602,7 @@ public function vi_create_main_page() public function vi_footer_text() { ?> - Variable Inspector is on github + Variable Inspector is on github | View changelog WordPress Newsboard: The latest from 100+ sources'; + $content = 'Also by Bowo → WordPress Newsboard: The latest from 100+ sources'; + return $content; } /**