Skip to content

Commit 64fcdaf

Browse files
committed
fix issue with deleted fields which was messging up the markup
1 parent bd9fd96 commit 64fcdaf

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

inc/admin.php

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ function ppom_admin_product_meta_column( $column, $post_id ) {
3737
if ( $ppom->has_multiple_meta() ) {
3838
$total_items = count( $ppom->meta_id ); // Get the total number of items.
3939
$current_item = 0; // Counter to track the current iteration.
40-
40+
$has_fields = false;
4141
foreach ( $ppom->meta_id as $meta_id ) {
4242
$current_item++; // Increment the counter.
4343

@@ -56,10 +56,13 @@ function ppom_admin_product_meta_column( $column, $post_id ) {
5656
if ( $current_item < $total_items ) {
5757
echo ', ';
5858
}
59-
} else {
60-
echo sprintf( __( '<a class="btn button" href="%1$s">%2$s</a>', 'woocommerce-product-addon' ), esc_url( $ppom_settings_url ), 'Add Fields' );
59+
$has_fields = true;
6160
}
61+
6262
}
63+
if( ! $has_fields ) {
64+
echo sprintf( __( '<a class="btn button" href="%1$s">%2$s</a>', 'woocommerce-product-addon' ), esc_url( $ppom_settings_url ), 'Add Fields' );
65+
}
6366
} elseif ( $ppom->ppom_settings ) {
6467
$url_edit = add_query_arg(
6568
array(

0 commit comments

Comments
 (0)