Skip to content

Commit

Permalink
Display Pronamic Pay payments in table view.
Browse files Browse the repository at this point in the history
  • Loading branch information
remcotolsma committed Sep 4, 2023
1 parent 9ec7fbc commit 32c54c4
Showing 1 changed file with 61 additions and 13 deletions.
74 changes: 61 additions & 13 deletions views/edit-payment.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,26 +10,74 @@
* @link https://gitlab.com/pronamic-plugins/restrict-content-pro/blob/3.0.10/includes/admin/payments/edit-payment.php#L127
*/

$pronamic_payment_id = (string) \rcp_get_payment_meta( $payment->id, '_pronamic_payment_id', true );

?>
<style type="text/css">
.pronamic-pay-payments-table th {
line-height: 1.4em;

padding: 8px 10px;
}
</style>

<tr>
<th scope="row" class="row-title">
<?php esc_html_e( 'Pronamic Pay Payment', 'pronamic_ideal' ); ?>
<?php esc_html_e( 'Pronamic Pay Payments', 'pronamic_ideal' ); ?>
</th>
<td>
<?php
<table class="pronamic-pay-payments-table wp-list-table widefat striped table-view-list">
<thead>
<tr>
<th scope="col"><?php esc_html_e( 'ID', 'pronamic_ideal' ); ?></th>
<th scope="col"><?php esc_html_e( 'Last', 'pronamic_ideal' ); ?></th>
</tr>
</thead>

<tbody>

<?php if ( $query->have_posts() ) : ?>

<?php while ( $query->have_posts() ) : ?>

<tr>
<?php $query->the_post(); ?>

<td>
<?php

printf(
'<a href="%s">%s</a>',
esc_url( get_edit_post_link() ),
esc_html( get_the_ID() )
);

?>
</td>
<td>
<?php

if ( $pronamic_payment_id === (string) \get_the_ID() ) {
echo '';
}

?>
</td>
</tr>

<?php endwhile; ?>

if ( $query->have_posts() ) {
while ( $query->have_posts() ) {
$query->the_post();
<?php else : ?>

printf(
'<a href="%s">%s</a>',
esc_url( get_edit_post_link() ),
esc_html( get_the_ID() )
);
}
}
<tr>
<td colspan="2">
<?php esc_html_e( 'No payments found.', 'pronamic_ideal' ); ?>
</td>
</tr>
<?php endif; ?>

?>
</tbody>
</table>
</td>
</tr>

0 comments on commit 32c54c4

Please sign in to comment.