Skip to content

Commit

Permalink
Merge pull request #204 from pronamic/203-only-list-next-payment-date…
Browse files Browse the repository at this point in the history
…-for-active-subscriptions

Only show next payment date for active subscriptions.
  • Loading branch information
rvdsteege authored Jan 15, 2025
2 parents 59c5976 + 60b7b03 commit e8f64eb
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions 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,6 +512,10 @@ public function custom_columns( $column, $post_id ) {
case 'pronamic_subscription_next_payment':
$next_payment_date = $subscription->get_next_payment_date();

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

echo empty( $next_payment_date ) ? '' : esc_html( $next_payment_date->format_i18n( \__( 'D j M Y', 'pronamic_ideal' ) ) );

break;
Expand Down

0 comments on commit e8f64eb

Please sign in to comment.