Skip to content

Commit

Permalink
Do not show copy toggle if meta field is empty
Browse files Browse the repository at this point in the history
  • Loading branch information
renatonascalves committed Aug 27, 2023
1 parent 8d8e5a4 commit ad37522
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions inc/class-table.php
Original file line number Diff line number Diff line change
Expand Up @@ -313,6 +313,9 @@ protected function format_value_for_output( $value ): string {
</button>
HTML;

// Don't show the copy button for empty values.
$copy_button = ! empty( $value ) ? $copy_button : '';

$expand_button = '<button type="button" class="expand-link" aria-label="' . esc_attr__( 'Expand', 'meta-inspector' ) . '">' . esc_html__( 'Expand', 'meta-inspector' ) . '</button>';

if ( is_string( $value ) && ! is_numeric( $value ) ) {
Expand Down

0 comments on commit ad37522

Please sign in to comment.