Skip to content

Commit

Permalink
Only show next payment date for active subscriptions.
Browse files Browse the repository at this point in the history
  • Loading branch information
remcotolsma committed Jan 13, 2025
1 parent 59c5976 commit 4050bdf
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/Admin/AdminSubscriptionPostType.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
use Pronamic\WordPress\Pay\Plugin;
use Pronamic\WordPress\Pay\Subscriptions\SubscriptionPeriod;
use Pronamic\WordPress\Pay\Subscriptions\SubscriptionPostType;
use Pronamic\WordPress\Pay\Subscriptions\SubscriptionStatus;
use Pronamic\WordPress\Pay\Util;
use WP_Post;
use WP_Query;
Expand Down Expand Up @@ -511,7 +512,13 @@ public function custom_columns( $column, $post_id ) {
case 'pronamic_subscription_next_payment':
$next_payment_date = $subscription->get_next_payment_date();

echo empty( $next_payment_date ) ? '' : esc_html( $next_payment_date->format_i18n( \__( 'D j M Y', 'pronamic_ideal' ) ) );
if ( SubscriptionStatus::ACTIVE === $subscription->get_status() ) {
echo empty( $next_payment_date ) ? '' : esc_html( $next_payment_date->format_i18n( \__( 'D j M Y', 'pronamic_ideal' ) ) );
}

if ( SubscriptionStatus::ACTIVE !== $subscription->get_status() ) {
echo '';
}

break;
case 'pronamic_subscription_date':
Expand Down

0 comments on commit 4050bdf

Please sign in to comment.