Skip to content

Commit

Permalink
Merge pull request #20 from alleyinteractive/feature/empty-copy-toggle
Browse files Browse the repository at this point in the history
Do not show copy toggle for empty meta fields
  • Loading branch information
renatonascalves authored Aug 28, 2023
2 parents 8d8e5a4 + ad37522 commit e606713
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 e606713

Please sign in to comment.