Skip to content

Commit

Permalink
Add handler for null type / value
Browse files Browse the repository at this point in the history
  • Loading branch information
qriouslad committed May 22, 2023
1 parent b1e9b61 commit 4b7e73a
Showing 1 changed file with 18 additions and 15 deletions.
33 changes: 18 additions & 15 deletions admin/class-variable-inspector-admin.php
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down Expand Up @@ -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'];
Expand Down Expand Up @@ -419,7 +418,7 @@ public function vi_inspection_results()
$output .= '<div class="accordion inspection-accordion">';
$output .= '<div class="accordion__control"><span class="variable-type">' . esc_html( $variable_type ) . '</span><span class="variable-name">' . esc_html( $variable_name ) . '</span><span class="variable-notes">' . esc_html( $variable_notes ) . '</span><span class="accordion__indicator"></span></div>';
$output .= '
<div id="' . esc_html( $identifier ) . '" class="accordion__panel">
<div id="' . esc_attr( $identifier ) . '" class="accordion__panel">
<div class="functions">
<a class="item" data-tab="var_export">var_export</a>' . $separator . '
<a class="item" data-tab="var_dump">var_dump</a>' . $separator . '
Expand Down Expand Up @@ -497,16 +496,19 @@ public function vi_create_main_page()

<?php
// Free version code
// Free version code
?>
<a href="https://bowo.io/vi-fdbk" target="_blank" class="vi-header-action">✚
<?php
esc_html_e( 'Feedback', 'variable-inspector' );
?>
</a>
<?php
?>

<a href="https://bowo.io/vi-rvw" target="_blank" class="vi-header-action"><span>★</span>
<?php
esc_html_e( 'Review', 'variable-inspector' );
?>
</a>
<a href="https://bowo.io/vi-fdbk" target="_blank" class="vi-header-action">✚
<?php
esc_html_e( 'Feedback', 'variable-inspector' );
?>
</a>

Expand Down Expand Up @@ -600,7 +602,7 @@ public function vi_create_main_page()
public function vi_footer_text()
{
?>
<a href="https://bowo.io/vi-dotorg" target="_blank">Variable Inspector</a> is on <a href="https://bowo.io/vi-gthb" target="_blank">github</a>
<a href="https://bowo.io/vi-dotorg" target="_blank">Variable Inspector</a> is on <a href="https://bowo.io/vi-gthb" target="_blank">github</a> | <a href="https://bowo.io/vi-chnglg" target="_blank">View changelog</a>
<?php
}

Expand All @@ -609,9 +611,10 @@ public function vi_footer_text()
*
* @since 2.0.0
*/
public function vi_footer_version_text()
public function vi_footer_version_text( $content )
{
return 'Also by Bowo &#8594; <a href="https://bowo.io/vi-bw" target="_blank">WordPress Newsboard</a>: The latest from 100+ sources';
$content = 'Also by Bowo &#8594; <a href="https://bowo.io/vi-bw" target="_blank">WordPress Newsboard</a>: The latest from 100+ sources';
return $content;
}

/**
Expand Down

0 comments on commit 4b7e73a

Please sign in to comment.