| @@ -68,9 +68,11 @@ | ||
| 68 | 68 | /* translators: %s: Subscription ID */ |
| 69 | 69 | : sprintf( __( 'Subscription #%s', 'subscription' ), $subscription_id ); |
| 70 | 70 | |
| 71 | 71 | $next_payment_date = $subscription_data['next_date'] ?? ''; |
| 72 | -$next_payment_date = ! empty( $next_payment_date ) ? wp_date( get_option( 'date_format' ), strtotime( $next_payment_date ) ) : ''; | |
| 72 | +$next_payment_date = ! empty( $next_payment_date ) && Helper::has_next_payment( $subscription_data['status'] ?? '' ) | |
| 73 | + ? wp_date( get_option( 'date_format' ), strtotime( $next_payment_date ) ) | |
| 74 | + : ''; | |
| 73 | 75 | |
| 74 | 76 | $header_badge = '<span class="wpsubs-badge wpsubs-badge--' . esc_attr( $badge_mod ) . '">' . esc_html( $verbose_status ); |
| 75 | 77 | if ( $is_grace_period && $grace_remaining > 0 ) { |
| 76 | 78 | /* translators: %d: days remaining */ |
| @@ -139,11 +141,9 @@ | ||
| 139 | 141 | } |
| 140 | 142 | // Always show the Next Payment tile; dash when there is no next date. |
| 141 | 143 | $summary_tiles[] = array( |
| 142 | 144 | 'label' => __( 'Next Payment', 'subscription' ), |
| 143 | - 'value' => ! empty( $subscription_data['next_date'] ) | |
| 144 | - ? esc_html( wp_date( get_option( 'date_format' ), strtotime( $subscription_data['next_date'] ) ) ) | |
| 145 | - : '-', | |
| 145 | + 'value' => $next_payment_date ? esc_html( $next_payment_date ) : '-', | |
| 146 | 146 | ); |
| 147 | 147 | // Total payments is not part of $subscription_data; pull it from the info rows. |
| 148 | 148 | if ( isset( $rows['total_payments'] ) ) { |
| 149 | 149 | $summary_tiles[] = array( |